Besides output, Python programs can also take input.
For this, the input
function is used.
For example, name = input()
makes the program prompt the user for an input.
The text that the user types in will be stored in the variable name
.
By writing name = input('What is your name? ')
, the program prompts for an input by printing What is your name?
.