简体   繁体   English

Python BMI 计算器语法错误和代码未运行方程

[英]Python BMI Calculator Syntax Error & Code Not Running Equation

语法错误

I still don't know what I am doing wrong?我仍然不知道我做错了什么? Why won't it take my named variables and square height and take the other and divide it by the square of the height?为什么它不采用我的命名变量和正方形高度,然后将另一个除以高度的平方?

Why is it indicating that the error is the name of the variable?为什么提示错误是变量名?

您忘记在第 2 行关闭一个括号

This is a simple fix on line 2 replace Height = float(input("Enter weight in meters") To Height = float(input("Enter height in meters")) As far as I can tell you just needed an extra bracket.这是第 2 行的一个简单修复,replace Height = float(input("以米为单位输入重量") To Height = float(input("以米为单位输入高度")) 据我所知,您只需要一个额外的括号。

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM