Discuss / Python / 打卡

打卡

Topic source

age=int(input('请输入您的年龄'))

if age>=60:

print('老年')

elif 60>age>=40:

print('中年')

elif 40>age>=18:

print('青年')

else:

print('未成年')

--1080°--

#2 Created at ... [Delete] [Delete and Lock User]

那到底在那输入年龄,全部写完吗

--1080°--

#3 Created at ... [Delete] [Delete and Lock User]

所以只能输入一次而已

age=input('请输入年龄:')

age=int(age)

if age>=60:

    print('老年')

if 60>age>=40:

    print('中年')

if 40>age>=18:

    print('青年')

if 18>age>=0:

    print('未成年')

if age<0:

    print('你是个什么鬼东西')


  • 1

Reply