+ 2
How can i do so, that when i give "Im fine thanks" it gives "No problem. How old are u?"
y = input("How are u:") if y in ("Im fine", "I'm fine", "Good", "Good!", "Im fine!", "Good.","Im fine.", "I'm fine", "I'm fine!"): print("Good, how old are u?") elif y == "Not good"or "Not Good" or "Not Good..." or "Not good." or "Not Good." or "Not good..." or "Bad" or "bad": print("How old are u?") elif y == "Im fine thanks" or "Im fine thanks!" or "I'm fine, thanks!" or "Im fine, thanks!" or "Im fine, thanks" or "Im fine, thanks!" or "Im fine, thanks" or "I'm fine, thanks." or "I'm fine thanks!": print("No problem, how old are u?") else: print("What?")
5 odpowiedzi
+ 2
У тебя снова та же ошибка.
почему в условии if ты правильно написал проверку, а в elif - по-старому?
elif y in ("Not good"or "Not Good" or "Not Good..." or "Not good." or "Not Good." or "Not good..." or "Bad" or "bad")
и так далее
+ 1
Говоришь как учитель)Но спасибо, буду лечиться)
+ 1
how about instead of trying to anticipate exactly what the user types by putting in somany options you just accept user input then continue from there. i feel like it’s alot more complicated than it should be
0
I believe that if you want to use ‘or’s like that, you need to restate the condition, but I am unsure. I have an issue with that.
0
You could check to see if general words like bad or good, is in the input and then go from there.