Back
I want to create a code that should read t lines of inputs. Each line is having 2 space-separated values first one is the name and the second is the age. An illustration of Input
Mike 18Kevin 35Angel 56
Mike 18
Kevin 35
Angel 56
How to input this kind of input in python?
You can simply use the below code that will help you in taking that kind of input:
the_string = raw_input()name, age = the_string.split()
the_string = raw_input()
name, age = the_string.split()
For more information regarding the same, do refer to the Python certification course.
31k questions
32.8k answers
501 comments
693 users