I am starting to code in python. When I was to take two inputs from user with a space between the two inputs my code was like
min, p = input().split(" ")
min=int(min)
p=float(p)
which worked fine. In another such problem I am to take a n*n matrix as user input which I declared as arr=[[0 for i in range(n)] for j in range(n)]
printing the arr gives a fine matrix(in a single row though) but I am to replace each element '0'with a user input so I use nested loops as
for i in range(0,n)
for j in range(0,n)
arr[i][j]=input()
this also worked fine but with a press of 'enter' button after each element. In this particular problem the user will input elements in one row at space instead of pressing 'enter' button. I wanted to know how to use split in this case like in first case above, keeping in mind the matrix is n*n where we don't know what is n. I prefer to avoid using numpy being a beginner with python.