Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

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 18

Kevin 35

Angel 56

How to input this kind of input in python?

1 Answer

0 votes
by (107k points)

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()

For more information regarding the same, do refer to the Python certification course. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...