0

Having trouble with BMI calculator math

I’m getting an error for line 3: Type Error, but I can’t find anything in the lessons that says floats can’t be exponents? What am I missing? 1 w=input(int()) 2 h=input(float()) 3 bmi=(w/(h**2))

19th Jun 2022, 11:46 AM
Melissa Fonseca
Melissa Fonseca - avatar
2 Answers
+ 4
Currently, your program is treating 'w' and 'h' variables as strings. You need to first take the input and then convert it to float. w = float(input())
19th Jun 2022, 11:58 AM
Sandeep
Sandeep - avatar
+ 2
Thank you Sandeep!
19th Jun 2022, 12:04 PM
Melissa Fonseca
Melissa Fonseca - avatar