Question : How to take multiple inputs in one line in python using split()
Answered by : gifted-gorilla-xyw7aqco8jjs
# 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 : https://www.codewithberi.xyz/how-to-take-multiple-inputs-in-one-line-in-python/ | Last Update : Tue, 01 Mar 22