Course: Python Foundations I - Getting Started
Age Group: 9-10 years old
Duration: 60 minutes
Term: 1 of 8 | Week: 1 of 8
By the end of this lesson, you will be able to:
print() command to display messages on screen"Hey there! I'm BrightByte, and I'm SO excited to meet you! Did you know I'm a robot who started out knowing absolutely nothing about coding? Zero. Zip. Nada! But guess what? I learnedโand now I get to help YOU learn too. Ready to discover something awesome together?"
BrightByte will be your coding companion throughout this entire journey. Whenever you see BrightByte's messages in these notes, pay special attentionโthere's usually something important or encouraging to remember!
"Every expert was once a beginnerโeven me! I made TONS of mistakes when I was learning. But here's the secret: mistakes aren't failures. They're just your brain leveling up! So don't worry if something doesn't work the first time. That's totally normal, and I'll be here to help you figure it out."
Have you ever wondered how your favorite things work?
The answer to ALL of these questions is codeโinstructions written by people (called programmers) that tell computers exactly what to do.
Programming is the skill of writing these instructions. And Python is one of the most popular and beginner-friendly ways to write them!
Here's something important to understand: computers are incredibly powerful, but they're also incredibly literal. They do EXACTLY what you tell themโnothing more, nothing less.
| Talking to a Person | Talking to a Computer |
|---|---|
| "Go get me some water" โ Works! | "Go get me some water" โ Too vague! |
| They figure out what you mean | Needs EXACT step-by-step instructions |
| They can guess and adapt | Can't guessโfollows instructions precisely |
| Understands context | Needs every detail spelled out |
Think of it this way: If you asked your friend to make you a sandwich, they'd probably figure it out. But if you asked a robot to make you a sandwich, you'd need to say something like:
That's how detailed computer instructions need to be! The good news? Once you write the instructions, the computer will follow them perfectly, every single time, as fast as lightning!
๐ญ Fun Fact: Python was created in 1991 by a Dutch programmer named Guido van Rossum. He named it after a funny British TV show called "Monty Python's Flying Circus"โNOT after the snake! Guido wanted programming to be fun, so he picked a fun name.
| Year | What Happened |
|---|---|
| 1991 | Python was created by Guido van Rossum |
| 2000 | Python 2.0 released with new features |
| 2008 | Python 3.0 released (what we use today!) |
| 2020s | Python becomes #1 most popular programming language |
| Today | Used by millions of people worldwide! |
Python is EVERYWHERE! Here are just some of the amazing things built with Python:
| Where | How Python is Used |
|---|---|
| ๐ฎ Video Games | Minecraft, Sims 4, Battlefield, Civilization IV |
| ๐ฑ Social Media | Instagram, Spotify, Pinterest, Reddit |
| ๐ค Robots | NASA Mars rovers, robot vacuums, drones |
| ๐ฌ Movies | Special effects in Disney, Pixar, Marvel films |
| ๐ง AI | ChatGPT, voice assistants, self-driving cars |
| ๐ฌ Science | Research at universities, medical discoveries |
| ๐ Websites | Google, YouTube, Netflix, Dropbox |
| ๐ฆ Banks | Managing money, detecting fraud |
| ๐ต Music | Spotify recommendations, sound analysis |
Python is PERFECT for beginners because:
โ
It reads almost like English (no weird symbols everywhere!)
โ
It's completely FREE for everyone
โ
Millions of people use it (so you can always find help!)
โ
You can make cool things quickly
โ
It's used for real jobs (not just learning!)
โ
One language lets you do MANY different things
There are many programming languages in the world. Here's how Python compares:
| Language | What It's Like | Used For |
|---|---|---|
| Python | Easy to read, like English | AI, science, websites, games |
| JavaScript | Runs in web browsers | Websites, web apps |
| Java | More structured, longer code | Android apps, big companies |
| C++ | Very fast, very complex | Video games, operating systems |
| Scratch | Visual blocks (no typing) | Learning basics |
Python is often called the "Swiss Army knife" of programming because it can do SO many different things!
BrightByte says: "Python was my first programming language too! It's perfect for beginners because you can focus on learning HOW to think like a programmer without getting confused by complicated symbols and rules. Trust me, you made a great choice!"
For this course, we'll use a website called Trinket (trinket.io) to write and run our Python code. Trinket is like a playground for codingโyou can write code, run it, and see what happens, all in your web browser!
Step 1: Open your web browser (Chrome, Firefox, Safari, or Edge)
Step 2: Go to trinket.io https://trinket.io/home
Step 3: Click "Sign Up" to create a free account (ask your parent if you need help with email)
Step 4: Once logged in, click "New Trinket" โ "Python"
Step 5: You'll see a screen split into two parts:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ต Trinket [Save] [Share] [โถ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ โ
โ YOUR CODE GOES HERE โ RESULTS APPEAR HERE โ
โ โ โ
โ (Type in this box) โ (Output shows here) โ
โ โ โ
โ โ โ
โ Line 1: print("Hello") โ Hello โ
โ Line 2: โ โ
โ Line 3: โ โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Line: 1 Col: 1 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Button | What It Does |
|---|---|
| โถ Run | Runs your code and shows the result |
| ๐พ Save | Saves your work (do this often!) |
| ๐ Share | Creates a link to share with your teacher |
| โฉ๏ธ Undo | Undoes your last change |
| โช๏ธ Redo | Brings back something you undid |
BrightByte says: "Pro tip: Save your work ALL THE TIME! I once spent an hour on a cool program and forgot to save... then my browser crashed. I had to start over! Don't be like old BrightByteโclick Save after every few lines of code!"
The print() command is your new best friend. It's the very first thing almost every programmer learns, and you'll use it constantly!
What does print() do? It tells Python to display a message on the screen.
Think of it like this:
| Part | What It Does |
|---|---|
print | The command name (means "show this on screen") |
() | Parentheses: a container for your message |
"" | Quotation marks: wrapping paper around your text |
The formula:
print("Your message here")
It's a tradition! Almost every programmer's very first program says "Hello, World!" This tradition started way back in the 1970s, and programmers have been doing it ever since. Now it's YOUR turn!
print("Hello, World!")
Try it yourself:
Hello, World!What happens behind the scenes:
print and knows you want to display something() to find WHAT to display"Hello, World!"๐ Congratulations! You just wrote your first program! You're officially a programmer now!
Let's make it personal. Change the message to include YOUR name!
print("Hi! My name is BrightByte!")
Your turn: Replace BrightByte with YOUR name!
print("Hi! My name is ______!")
Try these variations:
print("Hello! I'm learning Python!") print("My name is Alex and I'm 10 years old!") print("I'm going to be an amazing coder!")
Python reads code from top to bottom, just like reading a book! Each print() command runs in order, one at a time.
print("Welcome to Python!") print("I am learning to code!") print("This is awesome!")
Output (what appears on screen):
Welcome to Python!
I am learning to code!
This is awesome!
Notice how each print() creates a new line? That's automatic!
You can print ANYTHING you want! Emojis work too! ๐
print("๐ฎ I love video games!") print("My favorite color is blue.") print("I have a dog named Max.") print("I'm going to build amazing things with Python!") print("๐ To infinity and beyond!")
Sometimes you want to add space between your messages. You can print an empty string to create a blank line:
print("Chapter 1: The Beginning") print("") print("Once upon a time, there was a young coder...") print("") print("Chapter 2: The Adventure") print("") print("They discovered the magic of Python!")
Output:
Chapter 1: The Beginning
Once upon a time, there was a young coder...
Chapter 2: The Adventure
They discovered the magic of Python!
You can even create simple pictures using text! This is called "ASCII Art."
print(" * ") print(" *** ") print("*****") print(" *** ") print(" * ")
Output:
*
***
*****
***
*
It's a diamond! โจ
_BrightByte says: "Here's a fun challenge: try making a simple house, a smiley face, or your initials using print() and symbols like *, /, , |, and _. ASCII art is a great way to practice and have fun!"_
Every programmerโeven professionals who have coded for 20+ yearsโmakes mistakes. The key isn't to never make mistakes; it's knowing how to spot and fix them!
๐ Bugs are mistakes in your code. The word comes from the early days of computers when actual insects would sometimes get stuck in the machines and cause problems! A woman named Grace Hopper famously found a moth in a computer in 1947.
Debugging is the process of finding and fixing these mistakes. Think of yourself as a detective solving a mystery! ๐
Text (words and sentences) MUST be wrapped in quotation marks. Without them, Python gets confused!
# โ WRONG - Python gets confused! print(Hello World) # โ RIGHT - Text needs quotation marks! print("Hello World")
What happens with the wrong code: Python sees Hello and thinks, "What is that? That's not a command I know!" and gives you an error.
The error message might say: NameError: name 'Hello' is not defined
How to remember: Text always goes inside quotation marks "like this". Think of quotation marks as a gift box for your words!
Python is case-sensitive, which means it treats uppercase and lowercase letters as completely different!
# โ WRONG - Capital P doesn't work! Print("Hello World") # โ WRONG - All capitals doesn't work either! PRINT("Hello World") # โ WRONG - Mixed case doesn't work! pRiNt("Hello World") # โ RIGHT - Always lowercase! print("Hello World")
What happens: Python looks for a command called Print (with a capital P) and can't find it. It only knows print (all lowercase).
The error message might say: NameError: name 'Print' is not defined
How to remember: The print command is ALWAYS lowercase. Always. No exceptions!
Computers can't guess what you meant. If you spell something wrong, even by one letter, it won't work!
# โ WRONG - Missing letters prnt("Hello World") prit("Hello World") # โ WRONG - Extra letters printt("Hello World") # โ WRONG - Letters in wrong order pritn("Hello World") pirnt("Hello World") # โ RIGHT - Spelled correctly print("Hello World")
The error message might say: NameError: name 'prnt' is not defined
How to remember: P-R-I-N-T. Sound it out: "print." Double-check your spelling!
Parentheses () come in pairsโjust like socks! If you have an opening ( you MUST have a closing ).
# โ WRONG - Missing closing parenthesis print("Hello World" # โ WRONG - Missing opening parenthesis print"Hello World") # โ WRONG - No parentheses at all print "Hello World" # โ RIGHT - Both parentheses present! print("Hello World")
The error message might say: SyntaxError: unexpected EOF while parsing or SyntaxError: invalid syntax
How to remember: Every ( needs a ). They're partners!
Just like parentheses, quotation marks come in pairs!
# โ WRONG - Missing closing quote print("Hello World) # โ WRONG - Missing opening quote print(Hello World") # โ WRONG - Mismatched quotes (different types) print("Hello World') # โ RIGHT - Matching quotes! print("Hello World") print('Hello World') # Single quotes work too!
Note: You can use either double quotes " or single quotes ', but they must MATCH. If you start with " you must end with ".
The error message might say: SyntaxError: EOL while scanning string literal
When something goes wrong, Python tries to help you by showing an error message. Let's learn to read them!
Example error:
File "main.py", line 1
print("Hello World"
^
SyntaxError: unexpected EOF while parsing
Breaking it down:
File "main.py", line 1 - The problem is on line 1^ arrow points to WHERE Python got confusedSyntaxError - The type of mistakeunexpected EOF while parsing - Python reached the End Of File while still looking for something (in this case, the closing ))BrightByte says: "Don't be scared of error messages! They're actually trying to help you. When I was learning, I used to panic when I saw red text. But now I know that errors are just Python's way of saying, 'Hey, I need your help understanding something!' Read the message carefullyโit usually tells you exactly where to look."
Can you spot the bug in each of these? Try to fix them in your head, then test them in Trinket!
Bug #1:
print("Hello, my name is Sam!)
Bug #2:
Print("Welcome to my program")
Bug #3:
prnit("Python is awesome")
Bug #4:
print "This is a test"
Bug #5:
print("I love coding"
(Answers are at the end of this lesson!)
| Rule | Example | Why It Matters |
|---|---|---|
Use lowercase print | print("Hi!") | Python is case-sensitive |
| Put text in quotes | "Like this" | So Python knows it's text |
| Parentheses come in pairs | print( needs ) | Incomplete code won't run |
| Quotes come in pairs | "text" not "text | Python needs to know where text ends |
| Spelling matters! | print not prnt | Typos cause errors |
| Each print() = new line | Three prints = three lines | Automatic line breaks |
# The basic formula: print("Your message here") # Examples: print("Hello!") # Simple message print("I am 10 years old") # Sentence with numbers print("") # Blank line print("๐ Emoji work! ๐") # Emojis are fine! print('Single quotes work') # Either quote type is OK
| Word | Definition | Example |
|---|---|---|
| Python | A programming language for giving instructions to computers | We write code in Python |
| Programming | The skill of writing instructions for computers | Learning programming is fun! |
| Code | Instructions written for a computer to follow | print("Hi") is code |
| print() | A command that displays a message on the screen | print("Hello") shows "Hello" |
| Bug | A mistake in your code | Missing quotes is a bug |
| Debugging | Finding and fixing mistakes in code | I'm debugging my program |
| String | Text inside quotation marks | "Hello" is a string |
| Syntax | The rules for how code must be written | Forgetting quotes breaks syntax |
| Run | Execute/start your code | Click Run to see the output |
| Output | What your program displays/produces | The output was "Hello World" |
Create a program that greets someone. Include:
Example:
print("Welcome to my program!") print("My name is Alex.") print("I'm excited to learn Python today!")
Create a text-based poster all about you! Include at least 8 print() statements covering:
Starter code:
print("========== ALL ABOUT ME ==========") print("") print("Name: _______") print("Age: _______") # Add more lines here! print("") print("==================================")
Create a simple picture using only text characters! Here are some ideas:
Simple House:
print(" /\\") print(" / \\") print(" / \\") print("|------|") print("| [] |") print("|______|")
Smiley Face:
print(" **** ") print(" * * ") print("* O O *") print("* *") print("* \\/ *") print(" * * ") print(" **** ")
Your Challenge: Create your own ASCII art! Ideas: heart, star, tree, rocket, cat, robot
Write the beginning of a short story using print() statements. Make it at least 10 lines long and include:
Platform: Complete this assignment on Trinket
Create a Python program called "My Python Story" that tells a creative story about your first day learning to code. This is your chance to be creative!
Your program must:
print("")) to separate paragraphsNot sure what to write about? Here are some ideas:
Feel free to change this completely or start from scratch!
# My Python Story # By: [Your Name] # Date: [Today's Date] print("==========================================") print(" MY PYTHON STORY") print("==========================================") print("") print("Chapter 1: The Beginning") print("--------------------------") print("One day, something amazing happened...") print("I discovered a programming language called Python!") print("") print("Chapter 2: The Adventure") print("--------------------------") # Continue your story here! # What challenges did you face? # Who helped you along the way? print("") print("Chapter 3: The Victory") print("--------------------------") # How does your story end? # What did you learn? # What will you create next? print("") print("==========================================") print(" THE END") print("==========================================")
| Criteria | Points |
|---|---|
| Has a title | โญ |
| At least 10 print statements | โญโญ |
| Story has beginning, middle, end | โญโญ |
| Uses blank lines for spacing | โญ |
| Creative and original | โญโญ |
| Code runs without errors | โญโญ |
| Total | 10 points |
Bug #1: Missing closing quotation mark
# Wrong: print("Hello, my name is Sam!) # Fixed: print("Hello, my name is Sam!")
Bug #2: Capital P should be lowercase
# Wrong: Print("Welcome to my program") # Fixed: print("Welcome to my program")
Bug #3: Misspelled "print" as "prnit"
# Wrong: prnit("Python is awesome") # Fixed: print("Python is awesome")
Bug #4: Missing parentheses
# Wrong: print "This is a test" # Fixed: print("This is a test")
Bug #5: Missing closing parenthesis
# Wrong: print("I love coding" # Fixed: print("I love coding")
Lesson 2: Variables - Storing Information
Next week, you'll learn how to make Python REMEMBER things! Instead of just displaying messages, you'll store information in variablesโlike giving Python a notebook to write in.
Sneak peek:
name = "Alex" age = 10 favorite_color = "blue" print("Hello, my name is " + name) print("I am going to learn amazing things!")
Get ready to level up! ๐
You wrote your first Python code! You're officially a programmer now!
What you accomplished today:
print() commandBrightByte says: "High five! ๐ You just taught your brain something new! I'm SO proud of you for getting through your first lesson. Rememberโevery expert was once a beginner, and today you took your first step on an amazing journey. Keep practicing, keep being curious, and I'll see you next week! Let's figure this out together!"
Want to practice more? Here are some fun resources:
KidsLearnAI - Empowering the Next Generation with AI Education
www.kidslearnai.ca
Instagram: @kids_learn_ai
Questions? Stuck on something? Don't worry! Ask your instructor or parent for help. Remember: asking questions is how all great coders learn!
Sign in to track your progress