chessBoard ={'1h':'bking','3e':'wking'}
def isValidChessBoard(board):
bking=0
wking=0
for v in board.values():
#bking=0
if v == 'bking':
bking = bking + 1
#wking=0
if v== 'wking':
wking= wking + 1
if bking or wking > 1:
print('This board is invalid')
else:
print('Board is good')
isValidChessBoard(chessBoard)
Hello, everyone. Does anyone have some insight as to why the if statement is executing? It is my understanding that because both bking and wking are less than 1 it should go to the else statement?