#coding=utf-8
if __name__ == '__main__':
age = 3
if age > 18:
print("adult")
elif age > 6:
print('teenager')
else:
print('baby')
结果:
adult
19
#coding=utf-8
if __name__ == '__main__':
age = 3
if age > 18:
print("adult")
elif age > 6:
print('teenager')
else:
print('baby')
结果:
adult
19
本文标题:Python3.x if elif else语句
本文链接:https://www.haomeiwen.com/subject/rvwgjktx.html
网友评论