It says Traceback (most recent call last):
File "python", line 40, in
IndexError: list index out of range
when I write something more than 5 in the console. It doesn't work for me please help!
Here's my code:
Write your code below!
if guess_col == ship_col and guess_row == ship_row:
print "Congratulations! You sank my battleship!"
if guess_row not in range(5) or \
guess_col not in range(5):
print "Oops, that's not even in the ocean."
elif board[guess_row][guess_col] == 'X':
print "You guessed that one already."
print "You missed my battleship!"
board[guess_row][guess_col] == 'X' <<<<<===== This is line 40 and it doesn't work wherever I put it