Discuss / Python / 作业

作业

Topic source

祥子920

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

#!/usr/bin/env python3

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

weight = float(input("please enter your weight(kg):"))

height = float(input("please enter your height(m):"))

print('your weight is',weight,'kg')

print('your height is',height,'m')

bmi = weight/(height*height)

print('your bmi is %.2f'%bmi)

if bmi>=32:

    print('严重肥胖')

elif bmi>=28:

    print('肥胖')

elif bmi>=25:

    print('过重')

elif bmi>=18.5:

    print('正常')

else:

    print('过轻')


  • 1

Reply