Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to take n space separated Integer in a list in python?

n = 5
lst = [int(i) for i in input().split()][:n]
print(lst)
Comment

PREVIOUS NEXT
Code Example
Python :: make virtual environment python 
Python :: python check if string is in a list 
Python :: pandas index append value 
Python :: joblib example 
Python :: seaborn factorplot python 
Python :: tkinter change button foreground 
Python :: time in python 
Python :: format numbers in column to percentage in python 
Python :: get hours from datetime.timedelta in python (Django) 
Python :: python dlib 
Python :: relative frequency histogram python 
Python :: django 3 create async rest api 
Python :: Maximize Difference codechef solution 
Python :: split function python 
Python :: importing logistic regression 
Python :: django insert bulk data 
Python :: conda create new env 
Python :: python invert colormap 
Python :: how to print a value of a key in nested dictionary python 
Python :: run python3 script in pytgon 
Python :: false in py 
Python :: drf model methods serializer 
Python :: upper python python.org 
Python :: python last index of item in list 
Python :: django MESSAGE_TAGS 
Python :: python date time 
Python :: flask multuple parameters 
Python :: how to do input python 
Python :: crypto trading bot python 
Python :: astype float across columns pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =