board= z=["O"]*5 for i in range(0,5): board.append(z) print board
this is the code i'm using in 4/19. when i submit this to 3/19 i get an error saying i have 5 references to one row, and that i should use a for loop (which im obviously using)
here's the code that ended up working for 3/19:
board= for i in range(0,5): z=["O"]*5 board.append(z) print board
how come in 4/19 its ok to declare z outside of the loop but in 3/19 it has to be declared inside the loop even though they're the same variable? wouldn't the latter variation actually run slower (albeit almost immeasurably) because you're declaring z every time you perform the loop?