Skip to content

Latest commit

ย 

History

History
916 lines (705 loc) ยท 37.5 KB

README.md

File metadata and controls

916 lines (705 loc) ยท 37.5 KB

๐Ÿ Session 19: Python Basics & Comparison

๐Ÿ“ธ Lesson Snapshot

Learn Python basics and discover how it compares to C# - two powerful languages, different flavors! (Grades K-12)

Session Date: Saturday, April 18, 2026 at 11:00 AM EST


๐ŸŽฏ Age-Tiered Learning Goals

๐Ÿง’ Grades 3-5 ๐Ÿง‘ Grades 6-8 ๐ŸŽ“ Grades 9-12
๐Ÿ Python Syntax Write simple print statements and variables Create functions and use loops Build classes and understand object-oriented concepts
๐Ÿ”„ Comparison Notice differences in how code looks Translate basic C# to Python Understand language paradigms and trade-offs
๐Ÿ“ฆ Data Types Use strings, numbers, and lists Work with dictionaries and tuples Implement type hints and understand duck typing
๐Ÿ By End Write a simple Python program that prints and uses variables Create a program with functions and loops Build a complete class-based program with Python

๐ŸŽจ Before You Code: Hands-On Activities (15 minutes)

๐Ÿ—ฃ๏ธ Activity 1: Two Languages, One Idea (Whole Class)

๐ŸŽฌ Setup: Show students the same program in C# and Python side-by-side

    THE SAME "HELLO WORLD" IN TWO LANGUAGES ๐ŸŒ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C# (What we've been learning):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  using System;                                       โ”‚
    โ”‚                                                      โ”‚
    โ”‚  class Program                                       โ”‚
    โ”‚  {                                                   โ”‚
    โ”‚      static void Main()                              โ”‚
    โ”‚      {                                               โ”‚
    โ”‚          Console.WriteLine("Hello, World!");         โ”‚
    โ”‚      }                                               โ”‚
    โ”‚  }                                                   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    Lines of code: 9 ๐Ÿ“

    Python (What we're learning today):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  print("Hello, World!")                              โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    Lines of code: 1 ๐Ÿ“

    ๐Ÿค” Discussion: "Python is like texting, C# is like writing a formal letter!"

๐Ÿ’ฌ Questions to Ask:

  • What do you notice is different? ๐Ÿ‘€
  • Which one looks easier to read? ๐Ÿ“–
  • Why might someone choose one over the other? ๐Ÿคท

๐ŸŽญ Activity 2: Curly Braces vs. Indentation Dance (Groups)

๐ŸŽฌ Setup: Students stand in groups, some are "C# code" and some are "Python code"

    HOW WE SHOW CODE BLOCKS ๐Ÿ“ฆ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C# Team (Use your arms as curly braces!):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                                      โ”‚
    โ”‚  if (happy)        ๐Ÿ‘ {  โ† Arms curve OUT           โ”‚
    โ”‚  {                                                   โ”‚
    โ”‚      jump();           ๐Ÿฆ˜ Jump!                     โ”‚
    โ”‚      spin();           ๐Ÿ”„ Spin!                     โ”‚
    โ”‚  }                 ๐Ÿ‘ }  โ† Arms curve OUT           โ”‚
    โ”‚                                                      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Python Team (Use steps forward for indentation!):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                                      โ”‚
    โ”‚  if happy:         ๐Ÿง Stand at start               โ”‚
    โ”‚      jump()            ๐Ÿ‘Ÿ Step forward, then jump!  โ”‚
    โ”‚      spin()            ๐Ÿ‘Ÿ Stay stepped, then spin!  โ”‚
    โ”‚                    ๐Ÿง Step back = block ended       โ”‚
    โ”‚                                                      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Key Insight:

"In Python, HOW FAR you step forward (indentation) is what shows your code blocks - no curly braces needed!"


๐Ÿ Activity 3: Python Name Origins (Fun Facts!)

    WHY IS IT CALLED PYTHON? ๐Ÿ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    โŒ NOT because of the snake!

    โœ… Named after "Monty Python's Flying Circus"! ๐ŸŽช
       (A silly British comedy show from the 1970s)

    The creator, Guido van Rossum, wanted:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  ๐ŸŽฏ A FUN name (not boring!)                        โ”‚
    โ”‚  ๐Ÿ“– An EASY language to read                        โ”‚
    โ”‚  ๐Ÿ˜Š Programming that feels PLAYFUL                  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Python's Philosophy (The Zen of Python):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  ๐ŸŒŸ "Beautiful is better than ugly"                 โ”‚
    โ”‚  ๐Ÿ“ "Simple is better than complex"                 โ”‚
    โ”‚  ๐Ÿ‘€ "Readability counts"                            โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—บ๏ธ Visual: C# vs Python at a Glance

    THE BIG PICTURE ๐Ÿ–ผ๏ธ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚        C# ๐Ÿ’œ          โ”‚         Python ๐Ÿ              โ”‚
    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
    โ”‚ Created: 2000         โ”‚ Created: 1991                 โ”‚
    โ”‚ By: Microsoft         โ”‚ By: Guido van Rossum          โ”‚
    โ”‚ Uses: Games, Apps,    โ”‚ Uses: AI, Data Science,       โ”‚
    โ”‚       Web APIs        โ”‚       Automation, Web         โ”‚
    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
    โ”‚ Type: Compiled        โ”‚ Type: Interpreted             โ”‚
    โ”‚ Typing: Static        โ”‚ Typing: Dynamic               โ”‚
    โ”‚ Blocks: { curly }     โ”‚ Blocks: indentation           โ”‚
    โ”‚ End lines: semicolon; โ”‚ End lines: nothing needed     โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


    WHAT DOES THIS MEAN? ๐Ÿค”
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    Compiled (C#):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  ๐Ÿ“ Your Code โ†’ ๐Ÿ”จ Compiler โ†’ ๐Ÿ’ฟ Program.exe        โ”‚
    โ”‚                                                      โ”‚
    โ”‚  Like baking a cake ๐ŸŽ‚                               โ”‚
    โ”‚  You mix ingredients, bake it ONCE,                  โ”‚
    โ”‚  then you can eat it whenever!                       โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Interpreted (Python):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  ๐Ÿ“ Your Code โ†’ ๐Ÿ Python reads line by line        โ”‚
    โ”‚                                                      โ”‚
    โ”‚  Like a live translator ๐Ÿ—ฃ๏ธ                          โ”‚
    โ”‚  Translates each sentence as you speak it!           โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Files for This Session

Session19/
โ”œโ”€โ”€ ๐Ÿ“„ README.md           โ† ๐Ÿ“– You're reading this!
โ”œโ”€โ”€ ๐Ÿ“„ hello_python.py     โ† ๐Ÿ Starter Python code
โ”œโ”€โ”€ ๐Ÿ“„ csharp_to_python.md โ† ๐Ÿ”„ Quick reference guide
โ””โ”€โ”€ ๐Ÿ“„ .gitignore          โ† ๐Ÿ™ˆ Python files to ignore

โœ… Prerequisites

  • โœ… Python 3 installed (python.org or via your package manager)
  • โœ… VS Code with Python extension
  • โœ… Basic understanding of programming from C# sessions
  • โœ… Excitement to learn something new! ๐ŸŽ‰

๐Ÿ› ๏ธ Step-by-Step: Installing Python

Step 1: Check If Python Is Already Installed

# Open your terminal and type:
python3 --version

# You should see something like:
# Python 3.11.0 โœ…

Step 2: If Not Installed, Get It!

    INSTALLING PYTHON ๐Ÿ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    Windows:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  1. Go to python.org/downloads                      โ”‚
    โ”‚  2. Click the big yellow "Download Python" button   โ”‚
    โ”‚  3. Run the installer                               โ”‚
    โ”‚  โš ๏ธ  CHECK "Add Python to PATH" at the bottom!      โ”‚
    โ”‚  4. Click "Install Now"                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Mac:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Option 1: Download from python.org                 โ”‚
    โ”‚  Option 2: Use Homebrew:                            โ”‚
    โ”‚            brew install python3                     โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Linux:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Usually pre-installed! If not:                     โ”‚
    โ”‚  sudo apt install python3                           โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Step 3: Install VS Code Python Extension

    IN VS CODE:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  1. Click Extensions icon (or Ctrl+Shift+X)         โ”‚
    โ”‚  2. Search "Python"                                 โ”‚
    โ”‚  3. Install "Python" by Microsoft                   โ”‚
    โ”‚  4. You're ready! ๐ŸŽ‰                                โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽ“ Lesson 1: Your First Python Program

๐Ÿฃ Grades 3-5: Print Statements

# ๐ŸŽ‰ My First Python Program!
# This is a comment - Python ignores it (just like // in C#)

print("Hello, World!")
print("I'm learning Python! ๐Ÿ")
print("This is SO much easier than C#!")

โ–ถ๏ธ How to Run:

python3 hello_python.py

๐Ÿ“Š C# Comparison:

    C#:                              Python:
    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€        โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    Console.WriteLine("Hi!");        print("Hi!")

    โœ“ No "Console." prefix
    โœ“ No semicolon needed
    โœ“ Uses regular parentheses

๐Ÿง‘ Grades 6-8: Variables and Data Types

# ๐Ÿ“ฆ Variables in Python - No type declarations needed!

# In C#, you'd write: string name = "Alex";
# In Python, just:
name = "Alex"
age = 13
height = 5.2
is_student = True

print(f"Name: {name}")
print(f"Age: {age}")
print(f"Height: {height} feet")
print(f"Is a student: {is_student}")
    VARIABLE COMPARISON ๐Ÿ“ฆ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C# (Must declare types):           Python (Types are automatic):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ string name = "Alex";       โ”‚    โ”‚ name = "Alex"               โ”‚
    โ”‚ int age = 13;               โ”‚    โ”‚ age = 13                    โ”‚
    โ”‚ double height = 5.2;        โ”‚    โ”‚ height = 5.2                โ”‚
    โ”‚ bool isStudent = true;      โ”‚    โ”‚ is_student = True           โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ†‘
                                       Notice: True with capital T!

๐ŸŽ“ Grades 9-12: Type Hints (Optional in Python!)

# ๐Ÿท๏ธ Type Hints - Tell Python what types you EXPECT
# Python won't enforce these, but they help readability!

name: str = "Alex"
age: int = 13
height: float = 5.2
is_student: bool = True
grades: list[int] = [95, 87, 92, 88]

def greet(person_name: str) -> str:
    """Return a greeting message."""
    return f"Hello, {person_name}!"

# Even with wrong types, Python runs (but linters will warn you!)
age = "thirteen"  # Works, but type hints say this should be int

๐ŸŽ“ Lesson 2: Getting User Input

๐Ÿฃ All Levels: Input Function

# ๐ŸŽค Getting input from the user

# In C#: Console.ReadLine()
# In Python: input()

name = input("What's your name? ")
print(f"Hello, {name}! Welcome to Python! ๐Ÿ")

# โš ๏ธ Input ALWAYS returns a string!
age_string = input("How old are you? ")
age = int(age_string)  # Convert string to integer

print(f"Next year you'll be {age + 1}!")
    INPUT COMPARISON ๐ŸŽค
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Console.Write("Enter name: ");                      โ”‚
    โ”‚ string name = Console.ReadLine();                   โ”‚
    โ”‚                                                      โ”‚
    โ”‚ Console.Write("Enter age: ");                       โ”‚
    โ”‚ int age = int.Parse(Console.ReadLine());            โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ name = input("Enter name: ")                        โ”‚
    โ”‚ age = int(input("Enter age: "))                     โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    ๐ŸŽ‰ Python combines the prompt AND reading in one step!

๐ŸŽ“ Lesson 3: If Statements and Conditions

# ๐Ÿ”€ Making Decisions in Python

age = int(input("Enter your age: "))

# Notice: No parentheses around condition, ends with colon!
if age < 13:
    print("You're a kid! ๐Ÿง’")
    print("Enjoy your childhood!")
elif age < 20:  # "elif" instead of "else if"
    print("You're a teenager! ๐Ÿง‘")
elif age < 65:
    print("You're an adult! ๐Ÿ‘จ")
else:
    print("You're a senior! ๐Ÿ‘ด")

print("Age check complete!")
    IF STATEMENT COMPARISON ๐Ÿ”€
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:                               Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ if (age < 13)               โ”‚   โ”‚ if age < 13:                โ”‚
    โ”‚ {                           โ”‚   โ”‚     print("Kid!")           โ”‚
    โ”‚     Console.WriteLine("Kid");   โ”‚ elif age < 20:              โ”‚
    โ”‚ }                           โ”‚   โ”‚     print("Teen!")          โ”‚
    โ”‚ else if (age < 20)          โ”‚   โ”‚ else:                       โ”‚
    โ”‚ {                           โ”‚   โ”‚     print("Adult!")         โ”‚
    โ”‚     Console.WriteLine("Teen");  โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ”‚ else                        โ”‚   โ”‚                             โ”‚
    โ”‚ {                           โ”‚   โ”‚                             โ”‚
    โ”‚     Console.WriteLine("Adult"); โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    KEY DIFFERENCES:
    โœ“ No parentheses around condition
    โœ“ Colon : instead of curly brace {
    โœ“ "elif" instead of "else if"
    โœ“ Indentation defines the block!

๐ŸŽ“ Lesson 4: Loops

For Loops ๐Ÿ”„

# ๐Ÿ”„ For Loops in Python

# Loop through a range of numbers
print("Counting to 5:")
for i in range(1, 6):  # 1, 2, 3, 4, 5 (doesn't include 6!)
    print(f"  {i}")

# Loop through a list
fruits = ["apple", "banana", "cherry"]
print("\nFruits:")
for fruit in fruits:
    print(f"  ๐ŸŽ {fruit}")

# C# foreach equivalent - it's the default in Python!
    FOR LOOP COMPARISON ๐Ÿ”„
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C# (counting):                    Python (counting):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ for (int i = 0; i < 5; i++) โ”‚   โ”‚ for i in range(5):          โ”‚
    โ”‚ {                           โ”‚   โ”‚     print(i)                โ”‚
    โ”‚     Console.WriteLine(i);   โ”‚   โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    C# (foreach):                     Python (for each):
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ foreach (var f in fruits)   โ”‚   โ”‚ for f in fruits:            โ”‚
    โ”‚ {                           โ”‚   โ”‚     print(f)                โ”‚
    โ”‚     Console.WriteLine(f);   โ”‚   โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

While Loops ๐Ÿ”

# ๐Ÿ” While Loops

count = 0
while count < 5:
    print(f"Count is: {count}")
    count += 1  # Same as count = count + 1

print("Done counting!")

# ๐ŸŽฎ Simple Guessing Game
import random

secret = random.randint(1, 10)
guess = 0

while guess != secret:
    guess = int(input("Guess a number (1-10): "))
    if guess < secret:
        print("Too low! โฌ†๏ธ")
    elif guess > secret:
        print("Too high! โฌ‡๏ธ")

print("๐ŸŽ‰ You got it!")

๐ŸŽ“ Lesson 5: Lists (Like C# Arrays/Lists)

# ๐Ÿ“‹ Lists in Python

# Creating a list
numbers = [1, 2, 3, 4, 5]
names = ["Alice", "Bob", "Charlie"]
mixed = [1, "hello", 3.14, True]  # Python allows mixed types!

# Accessing elements (same as C#!)
print(names[0])  # "Alice"
print(names[-1]) # "Charlie" (last item - Python special!)

# Adding items
names.append("Diana")  # Like C# .Add()
print(names)  # ["Alice", "Bob", "Charlie", "Diana"]

# Removing items
names.remove("Bob")    # Remove by value
print(names)  # ["Alice", "Charlie", "Diana"]

# List slicing (Python superpower! ๐Ÿฆธ)
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(numbers[2:5])    # [2, 3, 4] - from index 2 to 4
print(numbers[:3])     # [0, 1, 2] - first 3 items
print(numbers[7:])     # [7, 8, 9] - from index 7 to end
print(numbers[::2])    # [0, 2, 4, 6, 8] - every 2nd item!
    LIST COMPARISON ๐Ÿ“‹
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:                               Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ var nums = new List<int>    โ”‚   โ”‚ nums = [1, 2, 3]            โ”‚
    โ”‚     { 1, 2, 3 };            โ”‚   โ”‚                             โ”‚
    โ”‚                             โ”‚   โ”‚                             โ”‚
    โ”‚ nums.Add(4);                โ”‚   โ”‚ nums.append(4)              โ”‚
    โ”‚ nums.Remove(2);             โ”‚   โ”‚ nums.remove(2)              โ”‚
    โ”‚ nums.Count                  โ”‚   โ”‚ len(nums)                   โ”‚
    โ”‚ nums[0]                     โ”‚   โ”‚ nums[0]                     โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    ๐ŸŒŸ PYTHON BONUS - Negative Indexing:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  names = ["A", "B", "C", "D"]                       โ”‚
    โ”‚           [0]  [1]  [2]  [3]  โ† Forward index       โ”‚
    โ”‚          [-4] [-3] [-2] [-1]  โ† Backward index!     โ”‚
    โ”‚                                                      โ”‚
    โ”‚  names[-1] = "D"  (last item!)                      โ”‚
    โ”‚  names[-2] = "C"  (second to last!)                 โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽ“ Lesson 6: Functions

# ๐Ÿ”ง Functions in Python

# Basic function
def say_hello():
    print("Hello! ๐Ÿ‘‹")

say_hello()

# Function with parameters
def greet(name):
    print(f"Hello, {name}! ๐ŸŽ‰")

greet("Alex")

# Function with return value
def add(a, b):
    return a + b

result = add(5, 3)
print(f"5 + 3 = {result}")

# Function with default parameter
def greet_with_title(name, title="Friend"):
    print(f"Hello, {title} {name}!")

greet_with_title("Alex")           # "Hello, Friend Alex!"
greet_with_title("Alex", "Dr.")    # "Hello, Dr. Alex!"

# ๐ŸŽ“ Grades 9-12: Type hints in functions
def calculate_area(length: float, width: float) -> float:
    """Calculate the area of a rectangle."""
    return length * width
    FUNCTION COMPARISON ๐Ÿ”ง
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:                               Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ void SayHello()             โ”‚   โ”‚ def say_hello():            โ”‚
    โ”‚ {                           โ”‚   โ”‚     print("Hello!")         โ”‚
    โ”‚     Console.WriteLine("Hi");โ”‚   โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ”‚                             โ”‚   โ”‚                             โ”‚
    โ”‚ int Add(int a, int b)       โ”‚   โ”‚ def add(a, b):              โ”‚
    โ”‚ {                           โ”‚   โ”‚     return a + b            โ”‚
    โ”‚     return a + b;           โ”‚   โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    KEY DIFFERENCES:
    โœ“ "def" keyword instead of return type
    โœ“ No type declarations for parameters
    โœ“ Colon : instead of curly braces
    โœ“ snake_case naming (say_hello, not SayHello)

๐ŸŽ“ Lesson 7: Dictionaries (Like C# Dictionary)

# ๐Ÿ“– Dictionaries - Key-Value Pairs

# Creating a dictionary
student = {
    "name": "Alex",
    "age": 14,
    "grade": 8,
    "is_enrolled": True
}

# Accessing values
print(student["name"])      # "Alex"
print(student.get("age"))   # 14

# Adding/updating values
student["email"] = "alex@school.com"  # Add new
student["age"] = 15                    # Update existing

# Looping through dictionary
print("\nStudent Info:")
for key, value in student.items():
    print(f"  {key}: {value}")

# Check if key exists
if "name" in student:
    print(f"Found: {student['name']}")
    DICTIONARY COMPARISON ๐Ÿ“–
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:                               Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ var dict = new Dictionary   โ”‚   โ”‚ dict = {                    โ”‚
    โ”‚   <string, int>             โ”‚   โ”‚     "apple": 5,             โ”‚
    โ”‚ {                           โ”‚   โ”‚     "banana": 3             โ”‚
    โ”‚     {"apple", 5},           โ”‚   โ”‚ }                           โ”‚
    โ”‚     {"banana", 3}           โ”‚   โ”‚                             โ”‚
    โ”‚ };                          โ”‚   โ”‚                             โ”‚
    โ”‚                             โ”‚   โ”‚                             โ”‚
    โ”‚ dict["cherry"] = 7;         โ”‚   โ”‚ dict["cherry"] = 7          โ”‚
    โ”‚ dict.ContainsKey("apple")   โ”‚   โ”‚ "apple" in dict             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽ“ Lesson 8: Classes (Grades 9-12)

# ๐Ÿ—๏ธ Classes in Python

class Dog:
    """A simple Dog class."""

    # Constructor (like C# constructor)
    def __init__(self, name, age):
        self.name = name    # Instance variable
        self.age = age
        self.tricks = []    # Empty list

    # Method
    def bark(self):
        print(f"{self.name} says: Woof! ๐Ÿ•")

    # Method with parameter
    def add_trick(self, trick):
        self.tricks.append(trick)
        print(f"{self.name} learned {trick}!")

    # Method with return
    def get_info(self):
        return f"{self.name} is {self.age} years old"

# Using the class
buddy = Dog("Buddy", 3)
buddy.bark()
buddy.add_trick("roll over")
buddy.add_trick("fetch")
print(buddy.get_info())
print(f"Tricks: {buddy.tricks}")
    CLASS COMPARISON ๐Ÿ—๏ธ
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

    C#:                               Python:
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ class Dog                   โ”‚   โ”‚ class Dog:                  โ”‚
    โ”‚ {                           โ”‚   โ”‚     def __init__(self, name)โ”‚
    โ”‚     public string Name;     โ”‚   โ”‚         self.name = name    โ”‚
    โ”‚                             โ”‚   โ”‚                             โ”‚
    โ”‚     public Dog(string name) โ”‚   โ”‚     def bark(self):         โ”‚
    โ”‚     {                       โ”‚   โ”‚         print("Woof!")      โ”‚
    โ”‚         Name = name;        โ”‚   โ”‚                             โ”‚
    โ”‚     }                       โ”‚   โ”‚                             โ”‚
    โ”‚                             โ”‚   โ”‚                             โ”‚
    โ”‚     public void Bark()      โ”‚   โ”‚                             โ”‚
    โ”‚     {                       โ”‚   โ”‚                             โ”‚
    โ”‚         Console.WriteLine();โ”‚   โ”‚                             โ”‚
    โ”‚     }                       โ”‚   โ”‚                             โ”‚
    โ”‚ }                           โ”‚   โ”‚                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    KEY DIFFERENCES:
    โœ“ __init__ instead of constructor name
    โœ“ self instead of this
    โœ“ self is always the first parameter
    โœ“ No access modifiers (public/private) by default

๐Ÿ‹๏ธ Hands-On Practice Exercises

๐ŸŒŸ Exercise 1: Hello You! (Grades 3-5)

Create a program that:

  1. Asks for the user's name
  2. Asks for their favorite color
  3. Prints a personalized message
# YOUR TURN! Fill in the blanks:

name = input("What is your name? ")
color = input("What is your favorite color? ")

# Print a message using both variables
print(f"Hello ____! Your favorite color is ____!")

๐ŸŒŸ๐ŸŒŸ Exercise 2: Number Guesser (Grades 6-8)

Create a guessing game:

  1. Generate a random number 1-20
  2. Let the user guess
  3. Give hints (higher/lower)
  4. Count the guesses
import random

# YOUR TURN! Complete this game:

secret = random.randint(1, 20)
guesses = 0

print("I'm thinking of a number between 1 and 20!")

# Add a while loop here that:
# - Gets a guess from the user
# - Tells them if it's too high or too low
# - Stops when they guess correctly
# - Counts how many guesses they took

๐ŸŒŸ๐ŸŒŸ๐ŸŒŸ Exercise 3: Book Class (Grades 9-12)

Create a Book class that:

  1. Has title, author, and pages
  2. Has a method to display info
  3. Has a method to check if it's long (> 300 pages)
  4. Create a list of books and display them all
# YOUR TURN! Create the Book class:

class Book:
    def __init__(self, title, author, pages):
        # Initialize the attributes
        pass

    def display(self):
        # Print book info nicely
        pass

    def is_long(self):
        # Return True if over 300 pages
        pass

# Create some books and test your class!

๐Ÿš€ Challenge Exercises

โญ Challenge 1: Temperature Converter (All Levels)

Create a program that converts Fahrenheit to Celsius and vice versa.

  • Formula: C = (F - 32) ร— 5/9

โญโญ Challenge 2: Shopping List Manager (Grades 6-8)

Create a program that:

  • Lets users add items to a list
  • Lets users remove items
  • Shows the current list
  • Counts total items

โญโญโญ Challenge 3: Student Grade Book (Grades 9-12)

Create a program with:

  • A Student class with name and grades list
  • Methods to add grades and calculate average
  • Store multiple students in a dictionary
  • Display all students and their averages

๐Ÿ’ฌ Group Reflection (5 minutes)

๐Ÿ”„ Circle Share - Answer one:

  1. "Python is easier than C# because..."
  2. "I like C# better because..."
  3. "The biggest difference I noticed was..."
  4. "Indentation instead of curly braces makes me feel..."
  5. "I want to use Python for..."

๐Ÿ“– Vocabulary Wall

Term ๐Ÿ“ Kid-Friendly Definition ๐Ÿ’ป Example
๐Ÿ Python A programming language that's easy to read print("Hello!")
๐Ÿ“ Interpreted Code runs line by line, no compiling needed Just run python file.py
๐Ÿ”€ Dynamic Typing Variables can change types anytime x = 5; x = "hello"
๐Ÿ“ Indentation Spaces at the start of lines that matter! 4 spaces = inside a block
๐Ÿ”ง def Keyword to define a function def say_hi():
๐Ÿ“‹ List An ordered collection of items [1, 2, 3, "four"]
๐Ÿ“– Dictionary Key-value pairs (like a real dictionary!) {"name": "Alex"}
๐Ÿ—๏ธ class A blueprint for creating objects class Dog:
๐Ÿ”จ init The constructor method in Python def __init__(self):
๐Ÿ‘ค self Refers to the current object (like this in C#) self.name = name

๐Ÿ  Take-Home Connection

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง Talk to a family member:

"Today I learned Python! It's another programming language like C#, but it looks very different. Python uses indentation to organize code instead of curly braces, and it's used for things like AI and data science!"

๐ŸŒ Real-world Python uses:

  • ๐Ÿค– Artificial Intelligence (ChatGPT, image recognition)
  • ๐Ÿ“Š Data Science (analyzing data, making charts)
  • ๐ŸŽฎ Game scripting (Minecraft mods!)
  • ๐ŸŒ Websites (Instagram, Spotify backend)
  • ๐Ÿ”ฌ Science & Research (NASA, CERN)

๐Ÿค” Questions to explore:

  • What language would you choose for a video game?
  • Why do you think Python is popular for AI?
  • Can you think of a project where you'd use Python?

โœ… Session Checklist

Before you leave, make sure you can:

  • โœ๏ธ Write and run a basic Python program
  • ๐Ÿ“ฆ Create and use variables
  • ๐Ÿ”€ Use if/elif/else statements
  • ๐Ÿ”„ Write for and while loops
  • ๐Ÿ“‹ Create and manipulate lists
  • ๐Ÿ”ง Define and call functions
  • ๐Ÿ”„ Explain 3 differences between Python and C#

๐Ÿ”ฎ What's Next

In Session 20, we'll build a Web API with Python using Flask! ๐ŸŒถ๏ธ

    YOUR JOURNEY SO FAR ๐Ÿ—บ๏ธ

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                                         โ”‚
    โ”‚  ๐Ÿ“š Sessions 1-10:  C# Fundamentals & OOP              โ”‚
    โ”‚  ๐ŸŒ Sessions 11-15: Building Web APIs                   โ”‚
    โ”‚  ๐ŸŽจ Sessions 16-18: Frontend & JavaScript               โ”‚
    โ”‚  ๐Ÿ Session 19:     Python Basics  โ—€โ”€โ”€ YOU ARE HERE!   โ”‚
    โ”‚  ๐ŸŒถ๏ธ Session 20:     Flask Web APIs                     โ”‚
    โ”‚  ๐ŸŽญ Session 21:     Final Showcase!                    โ”‚
    โ”‚                                                         โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

You're becoming a multi-language programmer! ๐ŸŽ‰๐Ÿ๐Ÿ’œ