Python - 2. The Input Function
Python - 2. The Input Function
input(prompt)
The function input(prompt) prints the message 'prompt' to the screen and returns a line of
text typed by the user with the keyboard.
This function can be used to stop the program from running until the 'Enter' key or the
'Return' key is pressed.
Examples:
Notice how the number entered is a text string, so we cannot perform calculations with it. To
convert the text into a number you must use one of the following functions:
Exercise:
Write a program that prompts for your name on the screen and then prints a personalized
greeting with your name.