- 博客(7)
- 收藏
- 关注
原创 函数定义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
转载 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
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人