Sagar Devkota Sagar Devkota - 2 months ago 24
Python Question

How to accept user input in multi dimension list in Python?

I need to place user input in a multi dimension list in python. I am new at Python. Some user inputs would be

11001111
10001100
11000000


I need to place them in list

a[[1,1,0,0,1,1,1,1],[1,0,0,0,1,1,0,0],[1,1,0,0,0,0,0,0]]


What I do. And its completely useless

for i in range(3):
for b in range(7):
a[i][b] = int(input())

Answer Source

This could work too :

a = []
for x in range(3):
    a.append([int(let) for let in input('enter number:\n')])