0

What maybe wrong in my code

name1= "Sunday" height1= 2 Weight1= 90 name2= "Samuel" height2= 4 Weight2=100 name3="anu" height3=1 weight3=20 # bmi_calculator def bmi_calculator(name,height,weight): bmi= weight/(height**2) print("bmi") print(bmi) if bmi<25: return name + "not overweight" else: return name + "overweight" result1= bmi_calculator(name1,height1,weight1) result2= bmi_calculator(name2,height2,weight2) result3= bmi_calculator(name3,height3 ,weight3) print(result1) print(result2 ) print(result3 )

10th Jun 2020, 3:56 PM
Ajisegiri Sunday
Ajisegiri Sunday - avatar
3 Answers
+ 2
Write "weight1" instead of "Weight1" and same with "Weight 2".....after this it works fine🙂
10th Jun 2020, 4:06 PM
ANJALI SAHU
+ 1
Adeniran python is case sensitive. python sensitive to register of letters. weight1 and Weight1 are different variables for this language
10th Jun 2020, 4:08 PM
Petr
+ 1
Thanks it works fine now
10th Jun 2020, 4:16 PM
Ajisegiri Sunday
Ajisegiri Sunday - avatar