list1 = list() #empty list
num = input("How many elements do you want") #user tells the range(optional)
#iterating till user's range is reached
for i in range(int(num)):
n = input("Enter a value ")#asking for input of 1 value
list1.append(int(n))#adding that value to the list
print(list1)
#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)
x=[int(input()) for i in range(int(input("How many elements are in list : ")))] print(x)