Sagar Devkota Sagar Devkota - 7 months ago 50
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


I need to place them in list


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')])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download