Make a List


#1


I use this code pass 13.Battleship! - 3.make a list
but i don't know why the loop can work?

board.append(["O"]*5) did not use i to loop

[['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']]


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


#2

We use i to loop 5 times, but we do not use i for anything else, this is pefectly possible


#3

Thank you for your explanation,
i don't know loop can use like that until now.


#4