You do not put a space between every 0 so as not to split anything, just list the list on raw_input:
grid = [list(raw_input())]
for _ in range(3):
grid.append(list(raw_input()))
You can also use the comp list:
grid = [list(raw_input()) for _ in range(3)]
If you want to split, you will need to enter 0 0 0with spaces in between.
In [1]: "0 0 0".split()
Out[1]: ['0', '0', '0']
Trying to split "000"returns ['000']because there is no separator to split, no spaces, etc.
source
share