Kids Learn AI Logo
Lesson 1: Welcome to Python! โœจ
Your first steps into coding - learn what Python is and write your first program

Level 1, Lesson 1: Welcome to Python! ๐Ÿ

Course: Python Foundations I - Getting Started
Age Group: 9-10 years old
Duration: 60 minutes
Term: 1 of 8 | Week: 1 of 8


๐ŸŽฏ What You'll Learn Today

By the end of this lesson, you will be able to:

  • Explain what Python is and why programmers love it
  • Set up your coding environment and navigate the interface
  • Write and run your very first Python program
  • Use the print() command to display messages on screen
  • Identify and fix common beginner mistakes (bugs!)
  • Understand the vocabulary programmers use

๐Ÿค– Meet BrightByte!

"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!

BrightByte's Promise to You

"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."


๐Ÿ What is Python?

The Big Question: What is Programming?

Have you ever wondered how your favorite things work?

  • How does Minecraft know where to place a block when you click?
  • How does YouTube pick videos you might like?
  • How do video games know what to do when you press a button?
  • How does Alexa or Siri understand what you say?
  • How do apps on your phone know how to 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!

Computers Need EXACT Instructions

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 PersonTalking to a Computer
"Go get me some water" โœ… Works!"Go get me some water" โŒ Too vague!
They figure out what you meanNeeds EXACT step-by-step instructions
They can guess and adaptCan't guessโ€”follows instructions precisely
Understands contextNeeds 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:

  1. Walk to the kitchen
  2. Open the bread drawer
  3. Take out two slices of bread
  4. Place them on the counter
  5. Open the refrigerator
  6. Find the peanut butter jar
  7. Pick up the peanut butter jar
  8. Close the refrigerator
  9. Open the peanut butter jar
  10. Pick up a knife
  11. Scoop peanut butter with the knife
  12. Spread peanut butter on one slice of bread
  13. ... (and so on!)

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!

Why is it Called "Python"?

๐ŸŽญ 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.

A Brief History of Python

YearWhat Happened
1991Python was created by Guido van Rossum
2000Python 2.0 released with new features
2008Python 3.0 released (what we use today!)
2020sPython becomes #1 most popular programming language
TodayUsed by millions of people worldwide!

Why Learn Python?

Python is EVERYWHERE! Here are just some of the amazing things built with Python:

WhereHow Python is Used
๐ŸŽฎ Video GamesMinecraft, Sims 4, Battlefield, Civilization IV
๐Ÿ“ฑ Social MediaInstagram, Spotify, Pinterest, Reddit
๐Ÿค– RobotsNASA Mars rovers, robot vacuums, drones
๐ŸŽฌ MoviesSpecial effects in Disney, Pixar, Marvel films
๐Ÿง  AIChatGPT, voice assistants, self-driving cars
๐Ÿ”ฌ ScienceResearch at universities, medical discoveries
๐ŸŒ WebsitesGoogle, YouTube, Netflix, Dropbox
๐Ÿฆ BanksManaging money, detecting fraud
๐ŸŽต MusicSpotify 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

Python vs Other Programming Languages

There are many programming languages in the world. Here's how Python compares:

LanguageWhat It's LikeUsed For
PythonEasy to read, like EnglishAI, science, websites, games
JavaScriptRuns in web browsersWebsites, web apps
JavaMore structured, longer codeAndroid apps, big companies
C++Very fast, very complexVideo games, operating systems
ScratchVisual 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!"


๐Ÿ’ป Getting Started: Your Coding Environment

What is Trinket?

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!

Why Trinket?

  • โœ… No downloads or installation needed
  • โœ… Works on any computer, tablet, or Chromebook
  • โœ… Easy to save and share your work
  • โœ… Your teacher can see your projects
  • โœ… It's free!

Setting Up Trinket

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:

  • Left side: Where you TYPE your code
  • Right side: Where you SEE the results

The Trinket Interface

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ”ต 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                                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Important Buttons to Know

ButtonWhat It Does
โ–ถ RunRuns your code and shows the result
๐Ÿ’พ SaveSaves your work (do this often!)
๐Ÿ”— ShareCreates a link to share with your teacher
โ†ฉ๏ธ UndoUndoes your last change
โ†ช๏ธ RedoBrings 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!"


๐ŸŽ‰ Your First Python Code!

The print() Command

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:

PartWhat It Does
printThe 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")

Example 1: Hello, World! ๐ŸŒ

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:

  1. Type this code exactly as shown in Trinket
  2. Click the โ–ถ Run button
  3. Look at the right sideโ€”you should see: Hello, World!

What happens behind the scenes:

  1. Python reads your instruction from left to right
  2. It sees print and knows you want to display something
  3. It looks inside the parentheses () to find WHAT to display
  4. It sees the text inside quotation marks: "Hello, World!"
  5. It displays that text on the screen!

๐ŸŽŠ Congratulations! You just wrote your first program! You're officially a programmer now!

Example 2: Say Your Name!

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!")

Example 3: Multiple Messages

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!

Example 4: Get Creative!

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!")

Example 5: Creating Blank Lines

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!

Example 6: Making Patterns with Text

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!"_


๐Ÿ”ง Fixing Mistakes Like a Pro!

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!

What Are Bugs?

๐Ÿ› 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! ๐Ÿ”

Mistake #1: Forgetting Quotation Marks

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!

Mistake #2: Wrong Capitalization

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!

Mistake #3: Spelling Errors

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!

Mistake #4: Missing Parentheses

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!

Mistake #5: Missing or Mismatched Quotation Marks

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

How to Read Error Messages

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
  • The ^ arrow points to WHERE Python got confused
  • SyntaxError - The type of mistake
  • unexpected 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."

Debugging Challenge! ๐Ÿ”

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!)


๐Ÿ“ Key Takeaways

The Golden Rules of print()

RuleExampleWhy It Matters
Use lowercase printprint("Hi!")Python is case-sensitive
Put text in quotes"Like this"So Python knows it's text
Parentheses come in pairsprint( needs )Incomplete code won't run
Quotes come in pairs"text" not "textPython needs to know where text ends
Spelling matters!print not prntTypos cause errors
Each print() = new lineThree prints = three linesAutomatic line breaks

Quick Reference Card

# 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

Vocabulary Words

WordDefinitionExample
PythonA programming language for giving instructions to computersWe write code in Python
ProgrammingThe skill of writing instructions for computersLearning programming is fun!
CodeInstructions written for a computer to followprint("Hi") is code
print()A command that displays a message on the screenprint("Hello") shows "Hello"
BugA mistake in your codeMissing quotes is a bug
DebuggingFinding and fixing mistakes in codeI'm debugging my program
StringText inside quotation marks"Hello" is a string
SyntaxThe rules for how code must be writtenForgetting quotes breaks syntax
RunExecute/start your codeClick Run to see the output
OutputWhat your program displays/producesThe output was "Hello World"

๐ŸŽฎ Practice Activities

Activity 1: The Greeting Generator (5 minutes)

Create a program that greets someone. Include:

  • A welcome message
  • Your name
  • Something you're excited about

Example:

print("Welcome to my program!") print("My name is Alex.") print("I'm excited to learn Python today!")

Activity 2: The About Me Poster (10 minutes)

Create a text-based poster all about you! Include at least 8 print() statements covering:

  • Your name
  • Your age
  • Your favorite color
  • Your favorite food
  • Your favorite game or hobby
  • Your favorite animal
  • Something you're good at
  • Something you want to learn

Starter code:

print("========== ALL ABOUT ME ==========") print("") print("Name: _______") print("Age: _______") # Add more lines here! print("") print("==================================")

Activity 3: ASCII Art Challenge (10 minutes)

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

Activity 4: Story Time (15 minutes)

Write the beginning of a short story using print() statements. Make it at least 10 lines long and include:

  • A title
  • At least one character
  • A setting (where it takes place)
  • Something that happens

๐Ÿ  Homework: My Python Story

Platform: Complete this assignment on Trinket

The Assignment

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!

Requirements

Your program must:

  1. โœ… Have a title displayed at the top
  2. โœ… Include at least 10 print statements (aim for 15-20!)
  3. โœ… Tell a story with a beginning, middle, and end
  4. โœ… Use blank lines (print("")) to separate paragraphs
  5. โœ… Be creative and have fun!
  6. โœ… Run without errors

Story Ideas

Not sure what to write about? Here are some ideas:

  • The Robot's First Day: Write about BrightByte's first day learning to code (from BrightByte's perspective!)
  • The Magical Computer: Write about a kid who discovers their computer is magical and can create real things from code
  • The Coding Adventure: Write about yourself on a quest to become a master coder
  • The Bug Hunt: Write a mystery story where you have to find and catch bugs in a program
  • Future Coder: Write about what you'll create when you become an expert programmer
  • Python the Snake: Write a funny story about a snake named Python who learns to code

Story Starter Template

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("==========================================")

Grading Rubric

CriteriaPoints
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โญโญ
Total10 points

How to Submit

  1. Write your code on Trinket
  2. Save your work (click the ๐Ÿ’พ Save button)
  3. Click the Share button
  4. Copy the link
  5. Share the link with your instructor

๐Ÿ”‘ Debugging Challenge Answers

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")

๐ŸŒŸ Next Lesson Preview

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! ๐Ÿš€


๐ŸŽ‰ Congratulations!

You wrote your first Python code! You're officially a programmer now!

What you accomplished today:

  • โœ… Learned what Python is and why it's awesome
  • โœ… Set up your coding environment
  • โœ… Wrote and ran your first programs
  • โœ… Used the print() command
  • โœ… Learned how to spot and fix bugs
  • โœ… Created text-based output

BrightByte 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!"


๐Ÿ“š Extra Resources (Optional)

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

Lesson not completed
Python Code Editor
Press Ctrl+Enter to run code
1
2
3
4
5
6
7
Output:
Loading Python environment...