Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to take input for list in one line in python

# Reads two numbers from input and typecasts them to int using 
# map function 
x, y = map(int, input().split()) 
Comment

how to take input for list in one line in python

# Reads two numbers from input and typecasts them to int using 
# list comprehension 
x, y = [int(x) for x in input().split()] 
Comment

PREVIOUS NEXT
Code Example
Python :: Game of Piles Version 2 
Python :: python array colon 
Python :: django production 
Python :: django environment variables 
Python :: python projects with source code 
Python :: write a file python 
Python :: how to get local ip in python 
Python :: edit pandas row value 
Python :: How to join train and Test dataset in python 
Python :: random python between 0 and 1 
Python :: change dataframe to list 
Python :: double char python 
Python :: Returns the first n rows 
Python :: python os get path 
Python :: dataframe select columns based on list 
Python :: group multiple columns in pandas 
Python :: match statement 
Python :: add value to dictionary python 
Python :: how to create a set from a list in python 
Python :: turn characters to alpgabetic numper python 
Python :: seaborn pairplot python 
Python :: disbale tkinter textbox 
Python :: count occurrence in array python 
Python :: drop-trailing-zeros-from-decimal python 
Python :: python exception 
Python :: .describe() python 
Python :: draw box with mouse on image in canvas tkinter 
Python :: not equal to in django filter 
Python :: cors python 
Python :: mode with group by in python 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =