Q:

how to take input of a list in python

a = list(map(int,input("\nEnter the numbers : ").strip().split()))
4
for i in range(0, n): 
    ele = int(input()) 
  
    lst.append(ele)
1
x=[]  for i in range(int(input("How many elements are in list : "))):  x.append(int(input())) print(x) 
1
# creating an empty list 
lst = [] 
  
# number of elemetns as input 
n = int(input("Enter number of elements : ")) 
  
# iterating till the range 
for i in range(0, n): 
    ele = int(input()) 
  
    lst.append(ele) # adding the element 
      
print(lst) 
3

New to Communities?

Join the community