Sep-05-2023, 03:25 PM
(This post was last modified: Sep-05-2023, 03:43 PM by deanhystad.)
hi recently i started learning python my first project is BMI calculator after coding in (python 3.11) when i execute my code i get error saying float' object cannot be interpreted as an integer any help is much appreciated
my BMI coding:
my BMI coding:
weight = float(input('your weight in kg?:')) height = float(input ('your height in cm?:')) BMI = weight/(height/100)**2 print ('your BMI is', BMI) if BMI < 18.5: print ("under weight") if BMI > 25: print ("over weight") if BMI in range(18.5 , 24.9): print ("your BMI is IDEAL")thanks in advance
deanhystad write Sep-05-2023, 03:43 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.