python code with invalid syntax in line 11
class bmi():
def __init__(selfname,height_m,weight_kg):
self.name = Name
self.height_m = height
self.weight_kg = weight
def from_input(cls):
return cls(
input('Enter your name: '),
print("Hello ", name)
int(input('User ID: ')),
int(input('Reputation: ')),
)
bmi = weight_kg / (height_m ** 2)
print(bmi)
if bmi < 25:
print( name, "is not overweight")
else:
print( name, "is overweight")
python
类bmi(): definit(姓名、身高、体重): self.name=名称 self.height_m=高度 自重×千克=重量相关问题 更多 >
编程相关推荐