So I wrote a code that yields a grid with the help of some helpful stackoverflow users, and here it is..
import random
import string
for x in range(4):
for y in range(4):
print( '['+random.choice(string.ascii_letters)+']',end='' )
print()
and now I want to create a function moveleft(grid)
that will move every column to the left
For instance, if my grid looks like this at first..
[k][b][s][v]
[u][w][p][O]
[t][i][i][K]
[n][J][r][f]
then after executing moveleft(grid)
, this will be my grid,
[v][k][b][s]
[O][u][w][p]
[K][t][i][i]
[f][n][J][r]
what should I write up for moveleft(grid)
to work as the example provided above?