turn = 0 if turn < 3: print_board(board) print("Turn", turn + 1) print(ship_row) print(ship_col) if guess_row == ship_row & guess_col == ship_col: print("Congratulations! You sank my battleship!") break else: if board[guess_row][guess_col] == "X": print("You guessed that one already.") else: for i in range(5): if guess_col or guess_row != i: print("Oops, that's not even in the ocean.") print("You missed my battleship!") board[guess_row][guess_col] = "X" else: print "Game Over"
Getting an error at this line:
if guess_row == ship_row & guess_col == ship_col:
This happened out of nowhere when I added the break line like I was supposed to, and now I can't get this program to run.
Why do these error pop up in python? No matter how many times I delete the space and retab it's not working.