3. Help on coding


Hello All. I need a small help. Please tell me the issue here

URL - https://www.codecademy.com/courses/python-beginner-en-4XuFm/0/3?curriculum_id=4f89dab3d788890003000096#

I am getting this error

It looks like the rows are not represented as lists.

board = []
for i in range(0,5):



Why are you calling to board with i? Board is already a list.


Read the small text before the instructions, just append what the exercise prints out. Also papusalaatti is right, you don't have to call board[i] just the board itself :wink:



I am not getting your point. Still it is giving error.

board = []
for i in range (0,5):

Please help


You must handle 'O' as a list. Also it looks like your board only contains one 'O' per line.


@papusalaatti is right, this is currently your board:

board = []
for i in range (0,5):
print board

the print will output:

['O', 'O', 'O', 'O', 'O']

while you should have a 5x5 board:

[['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O']]


Hello All. Thank you for helping me. I have completed the Battle Ship.