代码

a = -1
if a > 0 :
print "a is greater than 0"
elif 0 == a :
print "a equals 0"
else :
print "a is less than 0"

运行结果

a is less than 0


更多内容请关注微信公众号

小朋友学Python(8):条件语句_微信公众号