I have no idea how to use a for loop to create the type of board they want me to…
I’m assuming they want me to create a board that looks like this:
‘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’
Now, I’ve been to the forums and seen that other people have had a lot of trouble with this particular exercise as well, and they usually end up with some form of this code:
board =
for x in range(0,5):
Circles = [“O”] * 5
board.append(Circles)
print board
This is all fine, I understand this code, but when I save and submit it, I get this output:
[[‘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’], [‘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’]]
[[‘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’]]
So… what am I missing