(Sep-05-2023, 03:49 PM)deanhystad Wrote: You cannot use float numbers for start, stop, step in range(start, stop, step). This is what is giving the error. Also, range does not do what you think it does. You should read up about range() because you'll be using it a lot.tnx Mod you're right it was simple than i thought range() function was really bad i only needed <= and >= .thanks for advice
Do you need this?
if BMI in range(18.5 , 24.9): print ("your BMI is IDEAL")To get here we already know that the bmi >= 18.5 and that bmi <= 25 because the earlier if statements already caught all under and overweight cases. Think about the problem first, then think about the code.
BMI code
Messages In This Thread |
RE: BMI code - by deanhystad - Sep-05-2023, 03:49 PM
RE: BMI code - by Reznick - Sep-05-2023, 07:22 PM
|
Users browsing this thread: 1 Guest(s)