a=20
if a > 0:
print("greater")
a=20
if a > 100:
print("greater")
else:
print("less")
a=20
if a > 100:
print("100")
elif a > 80:
print("80")
elif a > 60:
print("60")
else:
print("bad")
python中没有switch的语句,都是要用多个if…elif…elif 实现多个不同条件的分支
if a > 0:
if a > 100
print("100")
if a > 80:
print("80")
elif a > 50:
print("50")
elif a > 20:
print("20")
else:
print("positive")
else:
print("negative")