I am refactoring code for a Tic-Tac-Toe application in Python however i am running into trouble when rewriting the function that checks for a winning condition.
This is what i have right now
x = ('X', 'X', 'X')
o = ('O', 'O', 'O')
if ('X', '-', '-') == o or x:
print(True)
This returns True even though the string shown is clearly not either one of the ones it's been compared to. However what is even weirder is that when I compare it to just one tuple
if ('X', '-', '-') == o:
print(True)
True doesn't get returned. Can someone please explain why this happens