Progress
45%
Python Foundations

Beginner Coding Roadmap

Five hands-on modules take you from your first line of code to writing your own functions — one small win at a time.

Your Progress
  1. Setup & Tools
  2. First Program
  3. 3Variables Basics
  4. 4Control Flow
  5. 5Functions
Modules
Recommended Next
Module 3 · Variables Basics
Est. Duration: 60 min
Code on a laptop screen
Module 3

Variables Basics

Variables are how programs remember things. In this module you'll learn what a variable is, how to declare one, and how to use variables to store, combine, and print real data — finishing with a mini challenge to prove it.

Learning Objectives
  • Understand variables — what they are and why programs need them.

  • Declare and assign variables with strings and numbers.

  • Use variables in expressions and print their values to the console.

Lesson Sequence
  1. 1 Introduction 10 min
  2. Declare Variables 15 min
  3. 3 Use Variables 20 min
  4. 4 Mini Challenge 15 min
Lesson Workspace Lesson 3 of 4
Use Variables

Use Variables

Example Code
example.py

        
Your Code
my_code.py
Challenge

    Challenge Results

    Great job!

    You crushed the “Use Variables” challenge — your code ran without a single error.

    Feedback
    Tip: variable names can't start with a number — age2 works, 2age doesn't.
    Objectives Completed 3/3
    Understand variables
    Declare and assign variables
    Use variables in expressions
    Progress Earned
    +10 XP
    55%
    What's Next?