xxxxxxxxxx
input_str =
input
(
"Enter space-separated elements: "
)
arr =
list
(
map
(
int
, input_str.split()))
print
(
"Array:"
, arr)
xxxxxxxxxx
#Getting input for array from user
from array import *
a = array("i",[])
n = int(input("Enter the length of array "))
for i in range(n):
x = int(input("Enter the next value "))
a.append(x)
print (a)