python条件控制
作者:互联网
if语句的一般形式:
if condition1:
statement1
elif condition2:
statement2
else:
statement3
if语句可嵌套:
a = 2 if a < 10: if a < 5: print('small') elif a >= 5: print('medium') elif a >= 10: print('big')
结果为:
small
标签:语句,控制,elif,medium,10,python,small,条件,print 来源: https://www.cnblogs.com/daxiangcai/p/16152025.html