2022 lesson 31 条件测试,快捷操作
作者:互联网
1 """ 2 条件测试, 3 ctrl+alt+l 格式化,对齐,增加空格等 4 alt+enter 提示操作 5 """ 6 grade = 70 7 if grade >= 60: 8 print("及格") 9 10 if grade < 60: 11 print("不及格") 12 13 if grade == 100: 14 print("满分") 15 16 if grade != 100: 17 print("不是满分") 18 19 if grade >= 70 and grade < 90: 20 print("成绩中等") 21 22 if grade == 66 or grade == 77 or grade == 88 or grade == 99: 23 print("顺口", grade == 66 or grade == 77 or grade == 88 or grade == 99) 24 25 if grade >= 60: 26 if grade in [60, 70, 80, 90]: 27 print("成绩及格并且以零结尾", grade >= 6 and grade in [60, 70, 80, 90])
两个快捷操作很有用,很快捷。
标签:grade,31,60,快捷,2022,70,print,90,lesson 来源: https://www.cnblogs.com/scholarly/p/16542358.html