Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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)
Source by www.codewithberi.xyz #
 
PREVIOUS NEXT
Tagged: #How #multiple #inputs #line #python
ADD COMMENT
Topic
Name
1+5 =