Discuss / Python / 交作业==

交作业==

Topic source

h=input('please input height:') please input height:1.62 w=input('please input weight:') please input weight:58.88 bmi=float(w/(hh)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can't multiply sequence by non-int of type 'str' bmi=int(w)/(int(h)int(h)) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: '58.88' bmi=float(w)/(float(h)*float(h)) if bmi<18.5: ... print('chaoqing') ... if bmi<25: File "<stdin>", line 3 if bmi<25: ^ SyntaxError: invalid syntax if bmi<25: ... print('zhengchang') ... if bmi<28: File "<stdin>", line 3 if bmi<28: ^ SyntaxError: invalid syntax elif bmi<28 File "<stdin>", line 1 elif bmi<28 ^ SyntaxError: invalid syntax elif bmi<28: File "<stdin>", line 1 elif bmi<28: ^ SyntaxError: invalid syntax if bmi<18.5: ... print('chaoqing') ... elif bmi<25 File "<stdin>", line 3 elif bmi<25 ^ SyntaxError: invalid syntax elif bmi<25: File "<stdin>", line 1 elif bmi<25: ^ SyntaxError: invalid syntax if bmi<18.5: ... print('chaoqing') ... elif bmi<25: ... print('zhengchang') ... elif bmi<28: ... print('guozhogn') ... elif bmi<32: ... print('feipang') ... else: ... print('yanzhongfeipang') ... zhengchang


  • 1

Reply