Answers for "inputting list in python"

0

python list input

# creating an empty list
lst = []
 
# number of elements 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)
Posted by: Guest on October-28-2021
0

how to take list input in python

for i in range(0, n): 
    ele = int(input()) 
  
    lst.append(ele)
Posted by: Guest on October-01-2020

Code answers related to "inputting list in python"

Python Answers by Framework

Browse Popular Code Answers by Language