Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to take the input from a user in Python?

1 Answer

0 votes
by (108k points)

There is a built-in function in Python that will help you out for taking the input from a user. If you are using an older version of Python (2x), then you can use:

raw_input(‘Enter the user input: ‘)

If you are using the latest version of Python (3x), then you can use:

input(‘enter the user input: ‘)

The output will be as follows:


Now inside the box, you can just write your desired input, and this input will get stored in the text variable:

After passing your text, you can just hit the Enter button:

If you are looking for an online course to learn Python, I recommend this Python Certification program by Intellipaat.

Related questions

0 votes
1 answer
asked Jul 13, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 9, 2020 in Python by ashely (50.2k points)

Browse Categories

...