I am just learning python and what I am trying to do is take an input from a user and then check if the values in that input are in a list of acceptable inputs.
This is what I have so far:
start = []
while len(start) < 9 or len(start) > 9 and all(elem != 'X' or 'O' or '_' for elem in start):
start = list(input())
if len(start) < 9:
print("Length needs to be at least 9 symbols.")
elif len(start) > 9:
print("Please only input 9 symbols.")
elif any(elem != 'X' or 'O' or '_' for elem in start):
print("Please only use symbols X, O, _")
When I run this, everything works fine for the length but as soon and I try to see if the values in start equal (X, O, or _) is where it all falls apart. If the first two statements in the while loop are satisfied it will always print the 3rd if statement and then exit the loop.
What am I missing?