I am really confused about how to get the input for an array or list in a single line i usually code in python and i use this logic
N=int(input())
a=list[]
for i in range(N):
x=int(input())
lst=a.append(x)
lst1=str(lst).replace(',' ,' ')
print(lst1)
This is how i code but while passing the input when i give the input as 1 2 3 4 5
I am getting an error . kindly help me how to wrtie a code for taking input for such kind.
ValueError: invalid literal for int() with base 10: '3 4 9 1 6'