Need help with a task using input() method


I have to complete a little task I thought was going to be simple but I’m facing problems. A user has 3 options and depending on what he chooses a statement is to be printed. I apologize for these several lines of code being written in my language. So here’s my code:

unos = input("Izaberite jedan od ponudjenih unosa: Evo me opet!; 123; Programiranje")
if unos == "Evo me opet!":
    print("Dobrodosli opet!")
if unos == "123":
    print("Zasto opet ti?")
if unos == "Programiranje":
    print("Nema nista bez vjezbe!!!!")

Whatever option I enter literally nothing is printed. Why is it so? Also, I’d like to know if there is another way of doing this ‘‘a user has 3 options to chose from’’, because as you can see the way I did it is quite literal and ugly.

Thank you very much.

tried it:

seems to work, i put your code here:

1 Like

Thank you very much sir, you just solved my problem. Actually this is very embarrassing, I just realized what was wrong after seeing your screenshot: I wasn’t entering 123 right after that last long word but first I gave it a space and then would write 123. This probably happened because when using input method I got used to finish a question for a user with a colon and a space…

Thank you.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.