With Split input, you can take multiple inputs from users in Python. The split () function breaks the given input by the specified separator (by default space).
Example Split input in Python
Simple example code taking two inputs at a time using input split method. Generally, the split() method is used to split a string but it can use in taking multiple inputs.
x, y = input("Enter a two value: ").split() print("First : ", x) print("Second: ", y)
How to input multiple integers in Python
You can change the int to specify or initialize any other data structures.
x, y = map(int, input().split()) print(x) print(y)
Do comment if you have any doubts or suggestions on this Python input topic.
Note: IDE: PyCharm 2021.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.