Battleships (3/19)


#1

Can somebody help me with the loop im not sure how to do the loop it is asking me to do

thanks


#2

Hi, Use 'for-loop'

example.
for x in range(5):
board.append(["O"] * 5)


#3

@alexcollinskem, here is the required code. I suggest you go back and review earlier exercises/tasks to consolidate.

for i in range(0,5): #This is the loop
        list = ["O"] * 5 #This is the code for a row of the board
        board.append(list)
print board

Hope this helps,

~NocturnalDweller~


#4

Thanks for your help this has helped me understand the concept of a loop clearer


#5

Thanks for your help


#6

this worked for me.

board = []
for i in range(5):
board.append(["O"] * 5)