1、數(shù)學(xué)式:
= < <= != / % ==
2、關(guān)鍵字:
and(同時(shí)滿足)與or(滿足一種即可)
In 檢查是否在列表內(nèi)
3哮缺、布爾表達(dá)式
True False
4苟穆、If語(yǔ)句
If
If-else
If-elif-else
# coding:utf-8
user_input = input("please input you age")
if user_input ==0:
print "年齡不能為0"
elif user_input <2:
print u'他是嬰兒'
elif user_input >=2 and user_input <4:
print u'他正在蹣跚學(xué)步'
elif user_input >=4 and user_input<13:
print '他是兒童'
elif user_input >=13 and user_input<20:
print '青年人'
elif user_input>=20 and user_input<65:
print '成年人'