I'm just starting to learn python and i'm attempting to do the basic task of building a tic tac toe game. I'm having trouble returning the correct print string and I can't figure out why. I think it has something to do with my "or" statement. I'm trying not to look at the tutorials if I can avoid them.
def playerinput():
while True:
var = raw_input('What marker would you like? (X or O): ')
if var in ('X', 'O', 'x','o'):
break
print 'Invalid input.'
if var == 'X' or 'x':
print 'You have chosen X!'
else:
print 'You have chosen O!'
When I type in 'O' or 'o' to the raw_input popup it returns 'You have chosen X!'. I can't figure out what's wrong with my code.