APPLY YOUR LEARNING

Focused Activities

Read all three activity briefs. Complete the activity assigned by your teacher in your notebook and Python IDLE.

GREEN

Code Explorer

Guided build

Build a greeting program. Complete the missing parts independently.

________ = input("Enter your name: ")
print("Hello", ________)
  1. Choose a suitable variable name for both blanks.
  2. Run the completed program in Python IDLE.
  3. Enter your name and check the output.

Extended Activity

Add a second input to ask for your favourite hobby. Store it in a variable and display both your name and hobby.

AMBER

Code Creator

Create

Create a personalised profile. Write a Python program that:

  1. Asks the user for their name.
  2. Asks the user for their favourite hobby.
  3. Stores both responses in appropriately named variables.
  4. Uses print() to display both responses.

Test: Run the program and check whether both responses are displayed correctly.

Extended Activity

Add another input to ask for the user’s favourite UAE landmark. Store it in a third variable and display all three responses. Test the program using a second set of answers.

PALE BURGUNDY

Code Innovator

Design and analyse

Design a personalised welcome program. Create and execute a Python program that:

  1. Asks for the user’s name.
  2. Asks for their favourite subject.
  3. Stores both responses in appropriately named variables.
  4. Displays a personalised welcome message using both stored values.

Test and analyse:

Extended Activity

Add a third input to collect the user’s favourite UAE landmark. Display all three details, test with two different users, and explain how variables make the program reusable.