The code is given below.
board = []
yes = 0
board.extend('-' * 9)
for index, i in enumerate(board):
if index % 4 == 0 and yes < 3:
board.insert(index-1 ,'\n')
yes += 1
print(board)
This code gives a input like: ['-', '-', '-', '\n', '-', '-', '-', '\n', '-', '-', '\n', '-']
I cant understand why the third '\n' is coming.