I am trying to write code for a simple Rock Paper Scissors and I got stuck here because else or elif don’t work in my code. This is my code
I tried looking up why this didn’t work and I couldn’t find anything on the subject.
>Solution :
It seems you are mixing the order how to use if-elif-else.
Following is quoted from (and I recommend to check it deeper):
if, elif and else.. priority and chains
"else is the catch-all after all the if and elif statements were false. Putting it in the middle would be a syntax error.
if False:
print ‘first’
elif True:
print ‘second’
elif True:
print ‘third’ "
Happy coding!