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

0

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)
Posted by: Guest on February-22-2022

Code answers related to "How to take multiple inputs in one line in python using split()"

Browse Popular Code Answers by Language