您的位置:首页 > 编程语言 > Python开发

Python学习笔记03-if语句

2017-06-04 09:46 190 查看
cars = 'times'
cars == 'times'
true

if cars != 'aa':
print('cars')
&& == and
| == or

requested_toppings = ['mushrooms','onions','pineapple']

if 'mushrooms' in requested_toppings :
true

age = 19
if age >= 18:
 print("You are old enough to vote!")

if age >= 18:
print("You are old")
elif age <= 19:
print("You are middle")
else:
print("You are youny")
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: