Please help


#1

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

#2

the instructions:

Inside the loop, .append() a list containing 5 "O"s to board

an important word in this sentence is: list

question: Are you appending a list to board?


#3

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

I tried that before and It didn't work. It says 'Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: 'builtin_function_or_method' object has no attribute 'getitem' '


#4

.append() is still a method call, you can't just remove the parentheses from a method call

now it will attempt to access method by index, that won't work


#5

board.append(['O']) * 5. I tried this aswell


#6

programming isn't about trying. Its about understanding.

so now we append a list contain 1 "O" to the board, then append modifies the list and returns None

None * 5 will return an error


#7

thanks. so you have to modify inside the append.(). thanks for the help :slight_smile:


#8