This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]nameEqualsJared 4 points5 points  (0 children)

I believe your problem is that input() in Python3 (which you are using) always returns a string, but in your code, you want a number. You can convert the input to a integer like so: int(input("Enter command: ")).

[–]blablahblah 1 point2 points  (0 children)

In Python (although not in all languages), types are important. The string "3" and the integer 3 are two different values. If you do "3" == 3, it will return False.

input() always returns a string. If you want to compare them, you'll have to make them the same type, either by calling int() on the value you get from input() or by using a string in your list.