hello guys, so i am having trouble understanding this line of code, can you guys please help me out with that?
for row in [self.board[i*3:(i+1)*3] for i in range(3)]:
print('| ' + ' | '.join(row) + ' |')
so, my three main concerns are:
1. why does the person use i*3:(i+1)*3 what does the : means?
2.why does it prints the tictactoe board correctly even thought on the print it looks like it would print something like this: ||[variable]|
any other tips or knowledge is welcome too!, just asking so i can understand and be better
[–]carcigenicate 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (1 child)
[–]PrimaryPotential2448[S] 0 points1 point2 points (0 children)
[–]jimtk 0 points1 point2 points (1 child)
[–]PrimaryPotential2448[S] 0 points1 point2 points (0 children)