11. Danger, Will Robinson! line error


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>
Hello! I’m having trouble with part 11 of my code. My code is below:



# Write your code below!
if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sank my battleship!"
else:
    print "You missed my battleship!"
    board[guess_row, guess_col] = 'X', 'X' #this is where the error is occurring
    print print_board(board)


My error is:

Traceback (most recent call last):
File “python”, line 33, in
TypeError: list indices must be integers, not tuple

I don’t know what the error means. Thanks for any help in advance!


#2

Nevermind, I’ve figured it out!


#3
if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sank my battleship!"
else:
    print "You missed my battleship!"
    board[guess_row][guess_col] = 'X'
    print print_board(board)