Python学习笔记03-if语句

来源:互联网 发布:js遍历a标签 编辑:程序博客网 时间:2024/05/13 23:58
cars = 'times'cars == 'times'trueif cars != 'aa':    print('cars')&& == and| == orrequested_toppings = ['mushrooms','onions','pineapple']if 'mushrooms' in requested_toppings :    trueage = 19if 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")