How do I check user input against multiple lists in python?
Ex. I want to check if an input is in one of four lists. One list for up down left and right. Each list has different acceptable ways to make the program continue. Once the input is verified to be in one of the lists I will need to figure out how to make it check against the individual lists so that the input correlates correctly to the desired direction.
Custom characters are used in two spots but they print properly.
Current Code:
left = "<-"
right = "->"
up = "↑"
down = "↓"
up_list = ["up", "Up", "UP"];
down_list = ["down", "Down", "DOWN"];
right_list = ["right", "Right", "RIGHT"];
left_list = ["left", "Left", "LEFT"];
print("What would you like to do?")
print("Movement Choices: Up, Down, Left, Right: ")
option = input("Choice: ")
if option in up_list:
print(up)
if option in down_list:
print(down)
if option in left_list:
print(left)
if option in right_list:
print(right)
if option not in up_list, down_list, right_list, left_list:
print("error")