What’s wrong with this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What’s wrong with this code?

There is something wrong with this code and I cant figure it out. age = int(input("How old are you?") if age > 50: print ("HAH! Im older then you!") elif age < 50: print ("Come on! Im supposed to be older!") else: print ("We are the same age? Cool!")

20th Feb 2021, 9:48 AM
Canon Lucai-Sample
Canon Lucai-Sample - avatar
2 Answers
+ 8
The type of error has been mentioned! And I thank you forgot a paranthesis when calling "age" variable. You wrote: age = int(input("How old are you?") But it should be: age = int(input("How old are you?")) (A second closing paranthesis at the end)
20th Feb 2021, 10:00 AM
Stefan
Stefan - avatar
+ 5
It seems that your forgot some closing parenthesis.
20th Feb 2021, 9:53 AM
Théophile
Théophile - avatar