Lesson: Hello, Python! — My First Program
Materials Needed
- Computer or laptop with a keyboard
- Internet connection, if using Code Club online materials
- Python editor, such as Code Club’s online editor, Scratch Code Club workspace, Replit, or Thonny
- Typing practice website or a prepared typing passage
- Notebook and pencil
- Optional: printed “Python Detective” challenge cards
Lesson Overview
Age: 12 years
Subject: Coding and Digital Learning
Irish curriculum connection: This lesson supports Junior Cycle Digital Learning and key skills, especially managing information and thinking, communicating, staying well, and working with others. It develops computational thinking, problem-solving, creativity, and digital confidence.
Suggested length: 60–75 minutes
Learning Objectives
By the end of the lesson, the learner will be able to:
- Type accurately for 15 minutes while using good keyboard habits.
- Explain that Python is a programming language used to give instructions to a computer.
- Use
print()to display words and messages. - Use
input()to ask the user a question. - Store information in a variable and use that variable in a program.
- Make and test a short interactive Python program.
- Find and correct at least one simple coding error.
Success Criteria
I am successful if I can:
- Write a working
print()command. - Create a variable with a clear name, such as
nameorfavourite_food. - Use
input()to collect an answer. - Display the answer in a friendly message.
- Test my program and improve it when something goes wrong.
Key Vocabulary
- Python: A programming language.
- Code: Instructions written for a computer.
- Program: A set of instructions that a computer follows.
- Function: A built-in command that performs a task.
- Variable: A named storage space for information.
- String: Text inside quotation marks.
- Bug: A mistake in a program.
- Debugging: Finding and fixing mistakes in code.
Assessment Plan
- Formative assessment: Observe typing technique, ask prediction questions, check code after each small step, and listen to explanations.
- Practical assessment: The learner creates and runs a personalised interactive “Hello” program.
- Reflection: The learner explains what
print(),input(), and a variable do.
Lesson Structure
1. Introduction and Typing Warm-Up — 15 Minutes
Typing Practice
Begin with continued typing practice from the previous lesson.
- Ask the learner to sit comfortably with both feet on the floor.
- Remind them to look at the screen rather than the keyboard as much as possible.
- Encourage gentle key presses, correct finger placement, and accuracy before speed.
- Have the learner complete one or two short typing activities.
- Record one result, such as words per minute, accuracy, or a personal goal.
Typing challenge: Ask the learner to type the following sentence carefully:
Python helps people give clear instructions to computers.
Quick reflection:
- What was easier than last time?
- Which letters or symbols were tricky?
- What typing goal will you try to improve next time?
2. Hook and Lesson Goals — 5 Minutes
Ask:
How could you make a computer greet every visitor to your website, game, or app?
Explain:
“Today you are going to write your first Python program. You will make the computer say hello, ask questions, remember answers, and respond to the user.”
Show the learner the three commands they will meet:
print()
input()
name =
Tell the learner that the lesson will follow three steps:
- I do: Watch a short demonstration.
- We do: Build a program together.
- You do: Create and personalise a program independently.
3. I Do: Meet Python and print() — 10 Minutes
Open the Python editor. Explain that Python reads code from top to bottom.
Type and run:
print("Hello, world!")
Explain:
print()tells Python to show something on the screen.- The words are inside quotation marks because they are text.
- The brackets show what information should be used by the function.
Demonstrate a few more examples:
print("Welcome to Python!")
print("Coding is creative.")
print(12)
Ask the learner:
- What do you think will appear on the screen?
- What happens if the quotation marks are removed from the words?
- What might happen if a bracket is missing?
Quick check: Ask the learner to write one print() command that displays their favourite animal, food, or hobby.
4. We Do: Asking Questions with input() — 10 Minutes
Explain that a program becomes more interesting when it can interact with a person.
Type and run:
input("What is your name? ")
Explain:
input()asks the user to type an answer.- The message inside the brackets is called a prompt.
- Python waits until the user types an answer and presses Enter.
Ask the learner to predict what this program will do:
print("Welcome!")
input("What is your favourite game? ")
print("That sounds fun!")
Run the code together and discuss the result.
5. We Do: Storing an Answer in a Variable — 10 Minutes
Explain that a variable is like a labelled box where the computer can store information.
Build this program together:
name = input("What is your name? ")
print("Hello, " + name + "!")
Explain each line:
nameis the label for the information.=means “store this information in”.input()collects the user’s answer.- The answer is stored in the variable called
name. - The program uses
namein the greeting. - The
+joins pieces of text together.
Ask the learner to change the program:
name = input("What is your name? ")
hobby = input("What is your favourite hobby? ")
print("Hello, " + name + "!")
print("It is great that you enjoy " + hobby + ".
Remind the learner to include the final quotation mark in the last line. If appropriate, demonstrate a second version using an f-string:
print(f"Hello, {name}!")
print(f"It is great that you enjoy {hobby}.")
Explain that both versions join words and stored information together, but the first version is often easier for a beginner to understand.
6. You Do: Create a Personalised “Hello” Program — 15–20 Minutes
Challenge the learner to create a program that welcomes someone and learns at least three things about them.
Minimum requirements:
- Use at least two
input()commands. - Store answers in clearly named variables.
- Use at least three
print()commands. - Display a personalised message using the user’s answers.
Starter code:
print("Welcome to my Python program!")
name = input("What is your name? ")
favourite_food = input("What is your favourite food? ")
dream_place = input("Where would you like to visit? ")
print("Hello, " + name + "!")
print("I hear you like " + favourite_food + ".")
print("I hope you get to visit " + dream_place + " one day!")
Choice of themes: The learner may make the program about:
- A friendly robot
- A space explorer
- A football or sports quiz
- A favourite game
- A dream holiday
- A pet introduction
- A school or homeschool welcome program
Creative upgrade options:
- Add a fourth question.
- Give the program a funny welcome message.
- Ask the user for their age or favourite number and display it.
- Add a closing message, such as “Thanks for chatting!”
- Change the questions so the program has a clear theme.
7. Debugging Challenge — 5 Minutes
Explain that programmers expect mistakes. Finding and fixing mistakes is called debugging.
Ask the learner to find the problems in this code:
print("Welcome to Python!)
name = input("What is your name? "
print("Hello " + name)
Guide the learner to identify:
- The missing quotation mark after
Python! - The missing closing bracket in the
input()line - The need to test the program after making a correction
Debugging routine:
- Read the error message carefully.
- Look at the line named by Python.
- Check brackets and quotation marks.
- Make one change at a time.
- Run the program again.
8. Conclusion and Reflection — 5–10 Minutes
Ask the learner to explain the following in their own words:
- What does
print()do? - What does
input()do? - What is a variable?
- Why do strings need quotation marks?
- What does debugging mean?
Exit ticket: Complete these sentences:
- “Today I learned that
print()...” - “A variable is...”
- “One mistake I fixed was...”
- “Next time I would like my program to...”
Recap the lesson:
“Today you continued developing your typing skills and wrote your first Python program. You used print() to display messages, input() to ask questions, and variables to remember answers. You also practised testing and debugging, which are important skills for every programmer.”
Differentiation and Support
Support for a Learner Who Needs More Guidance
- Provide a partially completed program with the missing words highlighted.
- Focus first on one variable, such as
name, before adding more. - Use a checklist: brackets, quotation marks, spelling, then run the code.
- Allow the learner to copy one line at a time and explain each line aloud.
- Use sentence starters such as
print("I like...")andname = input("...").
Extension for a Learner Ready for More Challenge
- Add more questions and variables.
- Use an f-string to display answers.
- Create a short story that changes based on the user’s answers.
- Investigate what happens when a variable name contains a space.
- Compare two versions of the program and explain which is easier to read.
Home Learning or Follow-Up
Create a “Python Profile” program that asks five questions and gives the user a personalised summary. The learner should save the program and add comments explaining what each section does.
Optional comment example:
# This program asks questions and creates a friendly profile.