0

so in my code, I have a line as such:

self.board= [[[]]*7] * 10

where and it produces this board to use in my game:

[[[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], 
[], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []]]

is there a way to get it to produce this instead:

[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []],
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []], 
[[], [], [], [], [], [], []]

do note that I have removed the very first and last bracket, but this change of looks would make my code and terminal look a lot better.

Is there any way I can do this and also still use it later on?

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
coops
  • 31
  • 4

0 Answers0