+ 2

Code Coach turns out message that operator and needs two conditions not just one but I thought there are two. Can smb help pls?

I know the code is probably all wrong (I'm a complete newbie) anyway but I'm trying to solve it bit by bit and don't get, why it doesn't accept the second condition. https://code.sololearn.com/ct2Pnvhayx6G/?ref=app

16th Dec 2022, 9:17 PM
Sarah
4 odpowiedzi
+ 1
Hi, Sar ! • Don’t print out BMI (first print). Use elif insted of if after first if, but not on last • Use else knstead as last if (no condition) • your condition should looks like this: elif BMI >= 18.5 and BMI < 25: (BMI even after and)
16th Dec 2022, 9:37 PM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Thank you so much!
16th Dec 2022, 9:39 PM
Sarah
+ 1
Yes, each time you have a comparison you have to tell the computer what two things you’re comparing, also the computer sees it as “<num” and since it only has one thing being compared it can’t do anything but it’s told to do it so it results in error
17th Dec 2022, 1:17 AM
Kyle Clemmer
Kyle Clemmer - avatar
+ 1
Thank you. Now I know ☺️
17th Dec 2022, 1:52 AM
Sarah