In this tutorial, we are going to learn how to take input from the console in Python.
The interactive shell in Python is treated as a console. We can take the user entered data the console using input() function.
# taking input from the user a = input() # printing the data print("User data:-", a) Tutorialspoint User data:- Tutorialspoint
If you run the above code, then you will get the following result.
Tutorialspoint User data:- Tutorialspoint
The data that is entered by the user will be in the string format. If you have any doubts in the tutorial, mention them in the comment section.