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