Taking User Input in Python
|
|
| Taking User Input in Python |
To get input from the user in Python, you can use the intuitively named input function. For example, a game can ask for the user's name and age as input and use them in the game.
The input function prompts the user for input, and returns what they enter as a string (with the contents automatically escaped).
RUNEven if the user enters a number as input, it is processed as a string.