Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fill python list with input

lst = [ ] 
n = int(input("Enter number of elements : ")) 
  
for i in range(0, n): 
    ele = input()
    lst.append(ele) 
      
print(lst)

# this will add a specified amount of strings to the list (lst) 
Comment

fill python list with input

lst = [ ] 
n = int(input("Enter number of elements : ")) 
  
for i in range(0, n): 
    ele = input()
    lst.append(ele) 
      
print(lst)

# this will add a specified amount of strings to the list (lst) 
Comment

PREVIOUS NEXT
Code Example
Python :: python current date and time 
Python :: cos in python in degrees 
Python :: how to loop in python 
Python :: python get stock data 
Python :: django-admin command not found 
Python :: sklearn rmsle 
Python :: how to save query data into dataframe pscopg2 
Python :: pip install speedtest 
Python :: check python version ubuntu 
Python :: median of a list python 
Python :: python how to access clipboard 
Python :: E: Unable to locate package python3-pip 
Python :: python get current number of threads 
Python :: unban discord.py 
Python :: get video width and height cv2 
Python :: filter list with python 
Python :: remove nan from list python 
Python :: pandas capitalize column 
Python :: create an array with same value python 
Python :: rename multiple pandas columns with list 
Python :: python server http one line 
Python :: sort_values 
Python :: pip version 
Python :: get all occurrence indices in list python 
Python :: how to read pdf in python 
Python :: python get index of item in 2d list 
Python :: run unittest in terminal python 
Python :: text to speech python 
Python :: how to print right angle triangle in python 
Python :: min max and avg function of python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =