How To Take Multiple Inputs In One Line In Python

[Solved] How To Take Multiple Inputs In One Line In Python | Perl - Code Explorer | yomemimo.com
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

Answers related to how to take multiple inputs in one line in python using split

Code Explorer Popular Question For Perl