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
Build a greeting program. Complete the missing parts independently.
________ = input("Enter your name: ")
print("Hello", ________)- Choose a suitable variable name for both blanks.
- Run the completed program in Python IDLE.
- 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 a personalised profile. Write a Python program that:
- Asks the user for their name.
- Asks the user for their favourite hobby.
- Stores both responses in appropriately named variables.
- 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 a personalised welcome program. Create and execute a Python program that:
- Asks for the user’s name.
- Asks for their favourite subject.
- Stores both responses in appropriately named variables.
- Displays a personalised welcome message using both stored values.
Test and analyse:
- Run the program using two different sets of responses.
- Observe how the output changes.
- Explain why the same program can be reused with different inputs.
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.