#coding: utf-8
people = 20
cats = 30
dogs = 15
if False and True: # 看到了吗?if后面跟的是一些判断语句,如果为True就执行,否则就不执行
print "Too many cats! The world is doomed."
if people > cats:
print "Not many cats! The world is saved."
if people < dogs:
print "The world is drooled on!"
if people > dogs:
print "The world is try."
dogs += 5
if people >= dogs:
print "People are greater than or equal to dogs."
if people <= dogs:
print "People are less than or equal to dogs."
if people == dogs:
print "People are dogs."
ex29.py if语句
最新推荐文章于 2024-08-16 17:24:27 发布