def checker(guess_row, guess_col): if guess_row == ship_row and guess_col == ship_col: print "Congratulations! You sank my battleship!" elif guess_row != (0 or 1 or 2 or 3 or 4) or guess_col != (0 or 1 or 2 or 3 or 4): print "Oops, that's not even in the ocean." elif board[guess_row] or board[guess_col] == 'X': print "You guessed that one already." else: print "You missed my battleship!" board[guess_row][guess_col] = 'X' checker(guess_row, guess_col)
Every time I run this function I get the output "Oops, that's not even in the ocean."
My code isn't exactly like the instructions explained because I have been messing around with it for a while trying to get this to work. No matter my inputs for the guesses, I get the same output. Does anybody know what I am doing wrong?