Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to take multiple inputs in one line in python using split()

# taking two inputs in one line
x, y = input("Enter two values: ").split()
print("x: ", x)
print("y: ", y)

# taking three inputs in one line
x, y, z = input("Enter three values: ").split()
print("x: ", x)
print("y: ", y)
print("z: ", z)
Comment

PREVIOUS NEXT
Code Example
Python :: python generate dictionary in loop 
Python :: how to get only one column from dataset in python 
Python :: how to add elements to a dictionary 
Python :: python regex find 
Python :: Iterating Through Dictionaries with For Loops 
Python :: opencv webcam 
Python :: k fold cross validation from scratch python 
Python :: print colors in python 
Python :: how to delete record in django 
Python :: pandas split list in column to rows 
Python :: python bool 
Python :: how to set global variable in python function 
Python :: abstarct class python 
Python :: django generate openapi schema command line 
Python :: python zip files 
Python :: plot multiplr linear regression model python 
Python :: instance method in python 
Python :: Adding new column to existing DataFrame in Pandas using assign method 
Python :: python string replace letters with numbers 
Python :: lemmatization in nlp 
Python :: Python sort list alpha 
Python :: Subset data frame by date 
Python :: python readlines strip 
Python :: python __repr__ meaning 
Python :: python format string 
Python :: python sort 2d list different sort order for different columns 
Python :: nibabel image 
Python :: Python Print hour, minute, second and microsecond 
Python :: merge sort of two list in python 
Python :: how to create one list from 2d list python 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =