Hi everyone, this is the last part of coding for this part. But I cannot get to replace the right position of "O" to "X".
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" # THIS PART IS SO FXXKING CONFUSING!
forgive me the French and the indent.
I just do not know why this line of code cannot replace the right place of "O".
To specify a single element in a 2-dimensional list, you need to give two indices. The syntax is: list_name[i][j], where i is an element in the outer list and j is an element in the inner list.
I did exactly as the hint is.
Someone help me? Thnaks