python简单题一道 求解答

2025-02-24 11:42:20
推荐回答(1个)
回答1:

#脚本:
#!/usr/bin/env python
weight=float(raw_input('please input your weight:'))
high=float(raw_input('please input your high:'))

print '{0:.2f}'.format(weight/(high**2))

#输出:
please input your weight:80
please input your high:1.75
26.12