Abu Dhabi Indian School · Grade 6 · Computer Science

Introduction to Python: Using input()

40-minute learning session · Think, predict, practise and record your answers in your notebook.

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?
  1. Write down two questions or instructions an ATM may display.
  2. Identify one piece of information you enter into the ATM.
  3. 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:

Key vocabulary: input(), function, prompt, user input, variable, assignment operator, string.

03 · Success criteria

I can…

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

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

  1. What message will appear on the screen?
  2. When will the program continue running?
  3. If the user types Aisha, what will be stored in name?
  4. 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

  1. Ask the user to enter their name.
  2. Ask the user to enter their favourite subject.
  3. Store both responses in appropriately named variables.
  4. Display a personalised welcome message using both responses.
  5. 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

  1. Identify the two pieces of information to collect: name and favourite hobby.
  2. Write one suitable input() statement for each response.
  3. Store each response in a suitable variable.
  4. Use print() to display a personalised message.
  5. 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 →