0

Am getting an error so how can I owed come that can anyone help me

Link to view my codes https://code.sololearn.com/cnR7z389GBt6/?ref=app

23rd Aug 2021, 2:35 PM
STEVE SONY
STEVE SONY - avatar
7 odpowiedzi
+ 2
looks like you have multiple inputs. in sololearn, you need to enter all your inputs in the one input box separated by a new line. example input: 20 80
23rd Aug 2021, 5:01 PM
you are smart. you are brave.
you are smart. you are brave. - avatar
+ 1
Hi STEVE! It's working without any errors. Are you sure that you're getting errors? Please double check you linked correct code in description
23rd Aug 2021, 2:39 PM
Python Learner
Python Learner - avatar
+ 1
Maybe input eg 1,80 instead of 1.80
23rd Aug 2021, 3:02 PM
Oma Falk
Oma Falk - avatar
0
Yes there is an error for me like when we give an output it and runs it shows an error
23rd Aug 2021, 2:49 PM
STEVE SONY
STEVE SONY - avatar
0
Yes
23rd Aug 2021, 2:50 PM
STEVE SONY
STEVE SONY - avatar
0
Can you tell us what are the inputs you tried to give? For me, it prints Normal for weight = 60 and height = 1.80
23rd Aug 2021, 2:58 PM
Python Learner
Python Learner - avatar
0
STEVE SONY The bug is in the last 'else' clause; the value '30' is left out. Try using the '>=' operator instead of the greater than operator. Here's how you can shorten your code: if x >= 30: print("Obese") elif x >= 25: print("Overweight") elif x >= 18.5: print("Normal") else: print("Underweight") Or just: print("Obese" * (x >= 30) or "Overweight" * (x >= 25) or "Normal" * (x >= 18.5) or "Underweight") # I hope that this answer helps you with your query. Happy coding!
25th Aug 2021, 6:02 AM
Calvin Thomas
Calvin Thomas - avatar