0

Hi everyone, I can't seem to find where I got it wrong. The elif statement is not recognised in my code. Please I need help.

answer = input("\nWhat is the capital of Nigeria? \n>>>") if answer == "Abuja" or "abuja" or "ABUJA" : print(answer, "is correct āœ…") elif answer!= "Abuja" or "abuja" or "ABUJA" : print(answer, "is a wrong answer āŒ ")

21st Oct 2021, 5:43 PM
David Alpha
David Alpha - avatar
6 Answers
+ 6
u donā€™t need elif in this case just use else answer = input() if answer.lower() == "abuja": print(answer, "is correct āœ…") else: print(answer, "is a wrong answer āŒ ")
21st Oct 2021, 5:52 PM
ubai
ubai - avatar
+ 2
if answer == "Abuja" or answer == "abuja " or answer == "ABUJA" : print() else: print() you don't need to use elif. else is enough in your case.
21st Oct 2021, 5:51 PM
Bahhaāµ£
Bahhaāµ£ - avatar
+ 1
[BusyTheseDays] thanks alot šŸ™ŒšŸ¼ your answer was helpful āœ…šŸ¾
21st Oct 2021, 6:15 PM
David Alpha
David Alpha - avatar
+ 1
BahhašŸ§ thanks šŸ™ŒšŸ¼āœ…šŸ¾
21st Oct 2021, 6:25 PM
David Alpha
David Alpha - avatar
0
ubai thanks alot šŸ™ŒšŸ¼ your answer was helpful āœ…šŸ¾ I never knew how to use the .lower() module but now it's good to know it's useful.
21st Oct 2021, 6:22 PM
David Alpha
David Alpha - avatar