1list1 = list() #empty list
2
3num = input("How many elements do you want") #user tells the range(optional)
4
5#iterating till user's range is reached
6for i in range(int(num)):
7 n = input("Enter a value ")#asking for input of 1 value
8 list1.append(int(n))#adding that value to the list
9
10print(list1)
1x = list(map(int, input("Enter the values with spaces between them: ").split()))
2# you can put the data type that you want in the "int" place
1x=[int(input()) for i in range(int(input("How many elements are in list : ")))] print(x)
1x=[] for i in range(int(input("How many elements are in list : "))): x.append(int(input())) print(x)