When I try to run this code
check = [sum(board[r[0]] + board[r[1]] + board[r[2]]) for r in test]
for row in check:
if row == win:
return True
I get a the error
TypeError: 'int' object is not iterable
However, when I run the following code, which does the same thing in a longer format, it runs smoothly and returns no errors
for row in winConditions:
checkA = board[row[0]]
checkB = board[row[1]]
checkC = board[row[2]]
if checkA + checkB + checkC == int(win):
return True
I am still gaining familiarity with list comprehensions, so I am unsure as to whether it is not possible, or is just some mistake that I have missed.