+ 2

A basic python question

I have a beginner program I can not get to work. What am I doing wrong? Thank You! name = input("What is your name?") print("Hello", name) question = input("What is your favorite color?" if question == blue print("Blue Bear") elif question == yellow print("Yellow Banana") else: print("Wrong")

30th Jan 2019, 4:10 PM
Markie Alicia
Markie Alicia - avatar
3 Respostas
+ 2
"blue" and "yellow" are strings, you need to use quotation marks
30th Jan 2019, 6:21 PM
Anna
Anna - avatar
+ 2
thank you!
30th Jan 2019, 9:02 PM
Markie Alicia
Markie Alicia - avatar
0
after question you forgot to close perentesies, after all if, elif an else statmebts you need :, and yellow is string
31st Jan 2019, 12:01 AM
Andrej Zrnic
Andrej Zrnic - avatar