people = 20
cats = 30
dogs = 15
print(dogs)
if people < cats:
如果20<15 执行下面代码
print( "Too many cats! The world is doomed!")
if people > cats:
如果20>15 执行这句代码
print( "Not many cats! The world is saved!")
if people < dogs:
如果20<15 执行这句代码
print( "The world is drooled on!")
if people > dogs:
如果20>15 执行这句代码
print( "The world is dry!")
让dogs由原来的值加5
dogs+=5
dogs=dogs+5=15+5=20
print(dogs)
if people > dogs:
如果20>20 执行这句代码
print("People are greater than or equal to dogs.")
elif people < dogs:
如果20<20执行这句代码
print ("People are less than or equal to dogs.")
else:
如果20=20执行这句代码
print ("People are dogs.")