Use a split() function to take multiple inputs in Python. This function helps in getting multiple inputs from users. It breaks the given input by the specified separator.
Example take multiple inputs in Python
Simple example code takes multiple space-separated inputs without using a while loop.
x, y, z = input("Enter a three value: ").split() print("Total number of students: ", x) print("Boys : ", y) print("Girls : ", z)
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.