#if语句
#检验相等
cars=[‘bmw’,‘audi’,‘toyota’,‘volvo’]
for car in cars:
if car==“bmw”: #不区分大小写
print(car.upper())
else:
print(car.title())
#检验不相等
if car[2]!=‘audi’:
print(“What’s up?”)
#and or用发
#检验特定值用in /not in
#bool布尔表达式 True/False
age=19
if age>=18:
print(“ENOUGH!”)
age=17
if age>=18:
print(“ENOUGH!”)
else:
print(“TOO YOUNG TOO SIMPLE”)
print("---------------------------------")
#if-elif-else
age=12
if age<10:
print(“你还没10岁呢”)
elif age>18:
print(“你都成年了”)
else:
print(“上不着天下不着地”)