01 · Starter / Hook
How does an ATM interact with you?
Imagine using an ATM. The screen may ask you to select a language, enter your PIN and choose an amount. How does the machine receive information from you?
- Write down two questions or instructions an ATM may display.
- Identify one piece of information you enter into the ATM.
- Predict: How could a Python program ask a user for information?
Notebook task: Write your responses. Be ready to share one idea.
02 · Learning objectives
By the end of this lesson, you will be able to:
- Explain the purpose of Python's
input() function.
- Identify the prompt displayed by
input().
- Write a basic
input() statement using correct syntax.
- Store user-entered information in a variable.
- Create and run a simple Python program that accepts user input.
Key vocabulary: input(), function, prompt, user input, variable, assignment operator, string.
03 · Success criteria
I can…
- explain why
input() is used in a Python program;
- write an
input() statement correctly;
- store the information entered by a user in a variable; and
- run a program and check whether it accepts the expected input.
04 · Guided instruction
Meet the input() function
The input() function pauses a program and waits for the user to type information. The message inside its brackets is called the prompt.
Teacher demonstration
name = input("Enter your name: ")
print(name)
Understand each part
- name — the variable that stores the information entered by the user.
- = — the assignment operator; it assigns the value received from
input() to the variable.
- input() — the function that receives information from the user.
- "Enter your name: " — the prompt displayed on the screen.
Remember: The prompt is displayed by the program. The user's response is typed after the prompt appears. The value returned by input() is a string.
Predict before the teacher runs the program
- What message will appear on the screen?
- When will the program continue running?
- If the user types Aisha, what will be stored in
name?
- What do you expect
print(name) to display?
Notebook task: Record your predictions. After the demonstration, write one observation and explain whether your prediction was correct.
Observe another example
hobby = input("Enter your favourite hobby: ")
print("Your hobby is", hobby)
Notice how the output changes when a different response is entered.
05 · Focused instruction · Independent practice
Your turn: Create a program
Complete the activity assigned by your teacher. Plan and write your code in your notebook first. Type and run it in Python IDLE when instructed by your teacher.
HA · High achievers
Task 1: Personalised welcome programme
- Ask the user to enter their name.
- Ask the user to enter their favourite subject.
- Store both responses in appropriately named variables.
- Display a personalised welcome message using both responses.
- Test the program using two different sets of responses. Explain how the output changes.
Extended challenge: Add a third input to collect the user's favourite UAE landmark. Display all three responses in a clear, personalised message. Test it with two different users and explain why using variables makes the program reusable.
MA · Average achievers
Task 2: My hobby
- Identify the two pieces of information to collect: name and favourite hobby.
- Write one suitable
input() statement for each response.
- Store each response in a suitable variable.
- Use
print() to display a personalised message.
- Run the program and check the output.
Extended challenge: Add a question about the user's favourite UAE landmark. Store the answer in a third variable and display a complete message using all three responses. Try a second set of answers and describe what changes.
LA · Low achievers
Task 3: Complete the greeting
Fill in the missing parts in your notebook. Use the word bank.
________ = input("Enter your name: ")
print("Hello", ________)
Word bank: name · name
Copy the completed program, run it when instructed and enter your name.
Extended challenge: Add a second input statement to ask for your favourite hobby. Store the answer in a new variable and display both your name and hobby.
Before you run your program: Check that every variable used in print() has been assigned a value. Use meaningful variable names and check spelling carefully.
Notebook reminder: Write the program, predict its output, record the actual output after the teacher allows you to run it, and note one correction or improvement you made.
Lesson navigation
Ready for the plenary?
Complete the review and exit ticket on the final page. Write all answers in your notebook.
Go to Plenary & Exit Ticket →