Inputs, Processes and Outputs
When a program asks you for data, two separate things happen: the program displays a message, and you type a reply. These two parts have different roles.
The message that asks you to enter data is called a prompt. A prompt is an output, because the program is showing it on screen. It is not the data itself — it is the instruction telling you what to type.
The data you type in response to the prompt is an input, because it enters the program from outside. For example, a bowling alley kiosk might display How many games will you play? — that message is the output. If you type 3, the value 3 is the input.
In Python, the input() function displays a prompt and returns a value. The text inside the brackets is shown on screen, so it is an output. The value the function returns is the text you typed, so it is an input. input() always returns text, so int() is used to convert it to a whole number before it is stored.
| Part | Example | Role |
|---|---|---|
| Message shown by the program | How many games will you play? | Output |
| Data typed by the user | 3 | Input |
# Bowling alley kiosk
games = int(input("How many games will you play? "))
print("Games booked: " + str(games))Output when the user types 3:
How many games will you play? 3
Games booked: 3The prompt is the output displayed by input(). The number you type is the input: int() turns the typed text into a whole number, which is stored in games.
OCR GCSE Computer Science · Inputs, Processes and Outputs
OCR GCSE Computer Science · Input