List view

Beginner Python Blocks

Every Block in this learning path, ordered from top to bottom.

← Map view
83 blocks in this path

1. First Code & Early Errors

Write your first lines of Python, use print(), add comments, and learn to recognize early errors.

  1. Quick intro to Python. What it is, who it's for, where it shines, and how to start!

  2. Write your first Python code with print(), show text and numbers, and learn how to fix tiny early errors.

  3. Learn how Python comments work, how to write helpful notes with #, and how to use comments without changing program output.

  4. Learn how to read Python's early error messages, find the broken line, and fix simple mistakes without panic.

  5. Learn how to spot and fix early Python syntax errors like missing quotes, parentheses, indentation issues, and invalid characters.

2. Values & Variables

Understand values, variables, number types, arithmetic, and the difference between expressions and statements.

  1. Learn what Python values and literals are, including numbers, strings, booleans, and None.

  2. Learn how Python variables work, how assignment stores values, and how to reuse named values in your code.

  3. Learn how to name Python variables clearly: valid names, snake_case, keywords, capitalization, and readable habits.

  4. Learn how Python variables can change values, how reassignment works, and why code like score = score + 1 is not as weird as it looks.

  5. Learn how to inspect Python values with type(), spot common beginner types, and understand why tiny quotes can change everything.

  6. Learn how Python handles whole numbers, decimal numbers, negative values, and number-looking text.

  7. Learn how to calculate with Python using addition, subtraction, multiplication, division, and variables.

  8. Learn how Python expressions produce values, how they fit inside statements, and how assignment evaluates the right side first.

  9. Learn how to use //, %, and ** in Python to split numbers into groups, find leftovers, and calculate powers.

3. Strings & Text

Create, combine, inspect, and slice text while learning Python's most useful string tools.

  1. Learn the basics of Python strings: text values, quotes, variables, empty strings, and why "25" is not the same as 25.

  2. Learn how to write Python strings with quotes, apostrophes, newlines, and escape characters.

  3. Learn how to join strings together in Python, handle spaces, and include numbers in text safely.

  4. Learn how to build clean Python text with f-strings, variables, simple expressions, and fewer plus-sign headaches.

  5. Learn how to clean, transform, replace, and split text in Python using basic string methods.

  6. Learn how to measure text length in Python with len(), including spaces, punctuation, and empty strings.

  7. Learn how to grab characters from Python strings using positive and negative indexes.

  8. Learn how to extract parts of strings using start, stop, step, negative indexes, and practical slicing patterns.

4. Input & Conversion

Read input from a user and convert it into the data types your program needs.

  1. Learn how to make Python programs interactive by asking the user for text with input().

  2. Learn why input() returns text and how to convert user input with int() and float() before doing math.

5. Booleans & Logic

Make decisions with Boolean values, comparisons, logical operators, and truthy or falsy data.

  1. Learn Python booleans: True, False, bool, flags, and why "True" is not the same as True.

  2. Learn how to compare values in Python and turn small questions into True or False.

  3. Combine boolean conditions with and, or, and not, then use parentheses to make complex rules clear.

  4. Learn how Python treats strings, numbers, and booleans as truthy or falsy, and when to use bool() versus exact comparisons.

6. Branching

Guide program flow with if, elif, else, nested conditions, and input validation.

  1. Learn how Python uses indentation and if statements to make decisions and run code only when conditions are met.

  2. Learn how to use else branches in Python to handle clean either/or decisions.

  3. Learn how to use elif chains to choose one path from several possible options.

  4. Learn how to put if statements inside other if statements and handle multi-step decisions clearly.

  5. Validate numeric and text input with if statements, clear rules, useful feedback, and membership checks.

  6. Combine input, strings, comparisons, branching, validation, arithmetic, and f-strings in your first larger Python project.

7. List Basics

Store ordered collections in lists and retrieve individual items or slices.

  1. Learn why Python lists exist and how to create clear, ordered collections of related values.

  2. Learn how to count list items with len(), handle empty lists, and avoid confusing length with indexes.

  3. Learn how to retrieve list items with positive, negative, and variable indexes—and understand IndexError.

  4. Learn to select parts of Python lists with start and stop indexes, omitted bounds, and negative indexing.

8. Loops I: for Loops & Loop Patterns

Repeat work with for loops, range(), break, continue, and accumulator patterns.

  1. Learn how Python for loops work, then use them to process list items directly and make simple decisions.

  2. Learn to repeat code, generate number sequences, and count forward or backward with Python's range().

  3. Learn how to stop loops early with break, skip individual iterations with continue, and choose the clearest loop pattern.

  4. Learn the accumulator pattern in Python: build totals, count matches, combine text, and avoid common loop mistakes.

  5. Learn how nested for loops work and use them to build grids, combinations, patterns, and multiplication tables.

9. Lists: Mutation & Building Patterns

Change, copy, build, sort, and combine lists without being surprised by mutation.

  1. Learn how to add, replace, and remove Python list items with append(), index assignment, pop(), and remove().

  2. Learn how to build new Python lists by collecting, filtering, and transforming values with loops.

  3. Learn why Python lists sometimes change together, then create safe copies and choose the right pattern.

  4. Sort and reverse Python lists while staying in control of whether the original list changes.

10. Loops II: while Loops

Use while loops for condition-driven repetition, validation, menus, and sentinel values.

  1. Learn how Python while loops use conditions and counters to repeat code, count in either direction, and move in custom steps.

  2. Learn when to use while loops, how to stop them safely, and how to fix infinite and off-by-one loops.

11. Dictionaries, Tuples & Sets

Choose and use dictionaries, tuples, and sets, including nested data and safe lookups.

  1. Learn why Python dictionaries exist and how to create clear, readable key-value records.

  2. Learn how to read dictionary values by key, add new entries, and update existing values.

  3. Check whether dictionary keys exist, avoid KeyError, and read optional values safely with in and get().

  4. Learn how to loop through dictionary keys, values, and key-value pairs, then build clear reports, totals, and filtered summaries.

  5. Learn how to organize, access, loop through, and update structured Python data using nested lists and dictionaries.

  6. Meet Python tuples: create fixed groups of values, read them by index, compare them with lists, and unpack them into clear variable names.

  7. Learn how Python sets keep values unique, simplify membership checks, and combine groups with union and intersection.

12. Functions

Turn repeated logic into reusable functions with parameters, return values, scope, and docstrings.

  1. Learn why functions exist, how to define and call them, and how they make repeated Python code easier to read and change.

  2. Learn how parameters and arguments give Python functions flexible inputs, including multiple values and positional order.

  3. Learn how Python functions return values, how to reuse those results, and why return ends the current function call.

  4. Learn when functions should return values, when they should print output, and why unexpected None values appear.

  5. Learn where Python variables are available, how function scope works, and how to move local values safely with return.

  6. Make Python functions easier to call with useful defaults, clear keyword arguments, and readable mixed calls.

  7. Learn how to write clear, useful docstrings that explain what Python functions do, accept, and return.

  8. Combine dictionaries, loops, lists, functions, and return values in a menu-driven inventory project.

13. Modules & Imports

Organize code with modules, imports, the standard library, and your own reusable files.

  1. Learn what Python modules are, where they come from, and how to reuse code with import and module.name.

  2. Import specific names, compare import styles, and use sqrt(), ceil(), floor(), and pi in practical calculations.

  3. Use Python's random module to roll numbers, pick list items, and build tiny games and generators.

  4. Learn how to organize related Python functions in your own module and import them wherever you need them.

14. Files & Data

Work with file paths, read and write text files, and read tabular CSV data.

  1. Learn how Python finds files with relative paths, absolute paths, and the current working directory.

  2. Open and read text files in Python, use with open(...) safely, and process the contents as a string.

  3. Learn when and how to process a text file one line at a time without loading its entire contents into one string.

  4. Learn to write and append text files in Python, add clean line breaks, and choose the right file mode without losing existing data.

  5. Learn to read rows and headers, convert text fields into numbers, and process simple tabular files with Python.

  6. Combine modules, CSV reading, dictionaries, random selection, loops, functions, and text-file appending in a multi-file quiz project.

15. Errors, Validation & Debugging

Recognize and handle exceptions, validate input, and debug programs systematically.

  1. Learn how to tell Python syntax errors from runtime exceptions and read the clues behind common failures.

  2. Learn how to use try/except, catch specific Python exceptions, and handle predictable runtime errors clearly.

  3. Learn how else gives successful exception-handling code its own clear path, and recognize what finally means when you encounter it.

  4. Combine loops, exception handling, and condition checks to keep asking until the user enters a valid value.

  5. Find Python bugs with purposeful print() calls, clear checkpoints, and small reproductions that keep the problem while removing the noise.

16. Code Style & Habits

Write readable Python, follow common style conventions, document intent, and understand unfamiliar code.

  1. Make your Python easier to read with clear names, consistent formatting, and useful comments.

  2. Learn how to spot repeated Python code and refactor it into clear, reusable functions and loops.

  3. Learn how to read unfamiliar Python code, trace its execution, predict its output, and make small changes safely.

  4. Build a multi-file expense report app using CSV reading, exceptions, dictionaries, functions, and text-file writing.