fullOfBombsCol = ["O"] * 6
fullOfBombs = [fullOfBombsCol] * 7
fullOfBombs[1][5] = 'x'
The result I get is :
[['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x'],
['O', 'O', 'O', 'O', 'O', 'x']]
which is not what I want to as I only want to change the last element of the second array in the array.
Would appreciate if anyone can help! Thanks!