I am trying to read integers in a single line in a loop. For example if I need to read 5 nos I would need to read them from the runtime as suppose 1 3 2 1 2. The problem is I don't know beforehand how many integers I need to read as it will also be provided at the runtime.
So far I have tried this:
c1=input()
c1=int(c1)
for i in range(c1):
ar[i]=int(input())
but it reads integers as :
1
3
2
1
2
Can anyone help?
print(ar)what you want?