Python
张流堂
这个作者很懒,什么都没留下…
展开
-
函数定义print以及return注意事项
class Restaurant():def init(self,restaurant_name):self.restaurant_name=restaurant_namedef describe_restaurant(self): print("This restaurant name is "+self.restaurant_name.title())my_restauran...原创 2020-02-10 21:20:19 · 381 阅读 · 0 评论 -
Python-元字典(dictionary)和集合(set)
原创 2020-01-29 23:08:46 · 159 阅读 · 0 评论 -
Python-if条件判断语句
原创 2020-01-29 23:08:05 · 134 阅读 · 0 评论 -
Python-元组(tuple)
原创 2020-01-29 23:07:18 · 124 阅读 · 0 评论 -
Python逻辑运算符
and or not优先级:() > not > and > or1.or在python中,逻辑运算符or,x or y, 如果x为True则返回x,如果x为False返回y值。因为如果x为True那么or运算就不需要在运算了,因为一个为真则为真,所以返回x的值。如果x的值为假,那么or运算的结果取决于y,所以返回y的值。1 print(1 or 2) # 12 p...转载 2019-11-26 18:50:29 · 620 阅读 · 0 评论 -
Python-变量和简单数据类型
原创 2019-11-24 16:04:15 · 140 阅读 · 0 评论 -
Python-列表
原创 2019-11-24 16:03:01 · 147 阅读 · 1 评论