11. Danger, Will Robinson! - traceback error


Hi guys, got this error
Traceback (most recent call last):
File "python", line 33, in
TypeError: list indices must be integers, not tuple

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!"


Replace this line with your code.


to access a multi-dimensional list you need to use square brackets twice:


what you did create a tulpe


for board[guess_row][guess_col]=="X"

i got the same error:(


You need to set this coordinate to X, not compare it with X. I helped you with the error which occurred, which means you can move forward a bit, and then you should take a moment to see if you can find what is causing the new error message


it should be just board[guess_row][guess_col] = "X"
not ==


my answer was already marked as solved and said the same thing? Not sure what the value of your answer is