Python3.x if elif else语句
2020-08-27 本文已影响0人
行走的风_75e2
#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