Discuss / Python / 为什么这样不能输入小数

为什么这样不能输入小数

Topic source

123123leoleo

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

a = input('please enter your height:') b = input('please enter your weight:') a = int(a) b = int(b) bmi = b/(a**2) print(bmi) 廖老师,请问为什么这样不能输入小数,只能输入整数

青花流融

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

你把int 改成float


  • 1

Reply