Lots of Errors - Careful, Will Robinson!



Gives this error message if I didn't enter the correct coordinates.

Traceback (most recent call last):
File "python", line 34, in
File "python", line 10, in print_board
TypeError: sequence item 1: expected string, list found

It shouldn't give any errors at all.

if guess_row == ship_row and guess_col == ship_col:
    print "Congratulations! You sank my battleship!"
    print "You missed my battleship!"
    board[guess_row][guess_col] = ["X"]


Never mind, I got it figured out.


So, what was the problem? I'm also struggling at the same place.


You shouldn't have the square brackets around the "X".


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.