An array is basically a data structure which can hold more than one value at a time. It is a collection or ordered series of elements of the same type.
Arrays can only take a single datatype element.
We can take input of arrays by different methods. Here we’ll study it by seeing examples.
a=int(input("Number of elements in the array:-")) n=list(map(int, input("elements of array:-").strip().split())) print(n)
Here we can see in the above example that we have used the map function to take the input of the array from the user.
a= n=int(input("Number of elements in array:")) for i in range(0,n): l=int(input()) a.append(l) print(a)
In the above example we have used for loop to get the input of array.
This is all about taking input of array.