If-else If Statement Not Working Properly
I am trying to make a multiplication game for my sister, but my code doesn't go through if-else statements properly. I have no idea why this is so. Can someone tell what I am doin
Solution 1:
raw_input
always returns a string
You need to convert it into the type you're comparing it to, in this case
int(raw_input("> "))
Solution 2:
raw_input
returns a string. This will never compare equal to a number. You need to convert the entered string to a number:
action = int(raw_input("> "))
Post a Comment for "If-else If Statement Not Working Properly"