Beginner — Day 1

Variables & Operations

Day Schedule
Online
TimeActivity
10:00Welcome
Welcome message, logistics and rules
10:20Pre-Assessment
Link provided separately
10:35Using CoCalc
Quick demo; students sign up in breakout rooms
10:45Variables & Data Types
int, float, str, bool; print(); string concatenation with +
11:10Break
11:20Breakout Groups
Project: About Me — students fill in their own values
12:20Reminders
In-Person
TimeActivity
8:00Welcome
Welcome message, logistics and rules
8:20Pre-Assessment
Link provided separately
8:35Using CoCalc
Quick demo; students log in
8:50Variables & Data Types
int, float, str, bool; print(); string concatenation with +
9:30Break
9:40Breakout Groups
Project: About Me — students fill in their own values
11:00Break
11:10Extra Activity
Mad Libs: reinforce variables and string concatenation in a fun context
11:50Open Coding
Catch up, explore, or extend the About Me program
12:20Reminders
Learning Objectives
  1. Implement variables in each data type (integer, float, string, boolean)
  2. Print variables individually using print()
  3. Concatenate strings using +
  4. Cast integers to strings using str()
  5. Perform basic math operations (+, -, *, /)
# INSTRUCTOR — Day 1: Variables & Operations (Beginner)
# -----------------------------------------------
# TEACH: A variable is a named box that holds a value.
# Show students how Python stores different types of data.
# Walk through each type, then have students change the values and re-run.

# TEACH: Four basic data types
name         = "Jordan"   # str  — text, always in quotes
age          = 12         # int  — whole number, no quotes
height       = 5.2        # float — decimal, no quotes
likes_coding = True       # bool  — exactly True or False (capital T/F)

# TEACH: Introduce print() BEFORE this demo — students haven't seen it yet.
# "print() is how we tell Python to display something on screen."
# Have students type each line below and run it one at a time:
#   print("Hello!")
#   print(100)
#   print("I am " + "12")
# Ask: what happens if you forget the quotes around a word? (NameError — try it live.)
# Give 3–4 minutes of free experimentation before moving to variables.

print("Name: " + name)
print("Age: " + str(age))           # TEACH: str() converts int → text so we can join strings
print("Height: " + str(height))
print("Likes coding: " + str(likes_coding))

# TEACH: Math works on numbers. Show what happens if you try name + 1 (error demo).
next_year_age = age + 1
print("Next year I will be " + str(next_year_age) + ".")

# TEACH: Ask students — what type is "5"? What about 5? Run both to show the difference.
print(type("5"))    # <class 'str'>
print(type(5))      # <class 'int'>

years_until_college = 18 - age
print("Years until college: " + str(years_until_college))
# INSTRUCTOR — Day 1: Project: About Me Program (Beginner)
# -----------------------------------------------
# TEACH: Students fill in their own values and run the program.
# Goal: every student leaves Day 1 with a working, personal Python program.
# Key skill: string concatenation with + and str() conversion.
# Common mistake: forgetting str() around an integer — show the error live.

name          = "Jordan"
age           = 12
favorite_food = "pizza"
grade         = 7
hobby         = "drawing"

print("Hi! My name is " + name + ".")
print("I am " + str(age) + " years old and in grade " + str(grade) + ".")
print("My favorite food is " + favorite_food + ".")
print("In my free time I love to " + hobby + ".")

# TEACH: demo this error on purpose, then fix it together
# print("I am " + age + " years old.")   # TypeError — show students why str() is needed

# TEACH: challenge students who finish early to add more facts about themselves
# INSTRUCTOR — Day 1: Extra Activity: Mad Libs (Beginner)
# -----------------------------------------------
# TEACH: Students see how variables slot into a sentence.
# The print statements are fixed — students only change the variable values.
# This reinforces string concatenation in a fun, low-stakes way.

adjective = "enormous"
animal    = "penguin"
place     = "the school cafeteria"
number    = 47
verb      = "started singing"

print("One day, a " + adjective + " " + animal)
print("walked into " + place + " with " + str(number) + " friends.")
print("They all " + verb + " and nobody knew what to do.")

# TEACH: after running, ask students to change each variable and re-run.
# Then challenge them to add two more print lines to finish the story
# using at least two new variables.

# Example challenge extension:
food    = "tacos"
emotion = "confused"
print("Someone handed them " + food + " and they looked very " + emotion + ".")
print("The end.")