Discuss / Python / 打卡,上一节我还在想,怎么才能输入指定类型的数据。。

打卡,上一节我还在想,怎么才能输入指定类型的数据。。

Topic source

偶尔如同

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

# -*- coding: utf-8 -*-

age = int(input())

if age > 18 and age <=30:

    print('Your age is ',age,'.You are adult,now.')

elif age > 30:

    print('Old boy!')

elif age <= 18:

    print('You\'re just a child')

height = 1.70

weight = 70

BMI = weight/(height*height)

print('Your BMI is:',BMI)

if BMI < 18.5:

    print('你的体重过轻')

elif BMI < 25:

    print('你的体重正常')

elif BMI < 28:

    print('你的体重过重')

elif BMI < 32:

    print('你有点肥胖')

elif BMI > 32:

    print('你已经严重肥胖')

else:

    pass


  • 1

Reply