Introduction to Programming with Python

Learn to program from scratch, even if you've barely used a computer: logic, algorithms and Python step by step, with exercises that run in your browser.

An 8-chapter program, plus a Chapter 0 to get you ready, designed for people who are truly starting from zero. First you learn to handle the computer, the keyboard and the platform; then you learn to think like a programmer with algorithms, flowcharts and PSeInt, and then you make the jump to Python: variables, data types, decisions and validation, loops, lists and functions. PSeInt is a pseudocode tool whose keywords are in Spanish (Algoritmo, Escribir, Leer, Si…); just like in the real tool, those keywords are kept in Spanish and explained in English the first time they appear, while variable names and messages are in English. Every topic is explained with everyday examples and practiced in labs with an interactive console and automated tests that tell you what to fix. You finish by building and presenting a menu-driven program that solves a real need.

9 chapters · 128 labs · ~56 h · US$7.99, one-time payment. The first 2 chapters are free.

What you'll be able to do

  • Analyze problems and design algorithms with input, processing and output.
  • Build Python programs with variables, data types, operators and clear messages.
  • Make decisions and validate data with if, elif, else and the and, or and not operators.
  • Process lots of data with for and while loops, counters, accumulators and sentinels.
  • Store, traverse and analyze collections of data with lists.
  • Organize programs into reusable functions, read error messages and test your code.
  • Create and explain a final project with a menu, validation, loops, lists and functions.

Syllabus

  1. Chapter 0 · Start here: your first program (free)

    Write and run your first lines of Python in minutes, on a computer or on your phone. At the end, an optional computer kit to get comfortable with the machine.

    1. Lesson: Your first program in 2 minutes (5 min)
    2. Lab: Your first program: a greeting (12 min)
    3. Lesson: Typing programming symbols (10 min)
    4. Lab: Message with apostrophes and quotes (12 min)
    5. Lab: Practice the programming symbols (15 min)
    6. Lab: Fix the greeting: three errors (12 min)
    7. Quiz: Quiz · Chapter 0: your first program (15 min)
    8. Lesson: The computer inside and out (14 min)
    9. Lesson: The mouse and windows (14 min)
    10. Lesson: The keyboard: the keys that give commands (16 min)
    11. Lesson: Files and folders (16 min)
    12. Lesson: The browser and the Internet (14 min)
    13. Lesson: How to use DOMLab step by step (18 min)
  2. Chapter 1 · Logic and problem solving (free)

    Learn to think like a programmer: algorithms, input-process-output, flowcharts and your first programs in PSeInt.

    1. Lesson: Programming is giving instructions: what an algorithm is (16 min)
    2. Lesson: Input, process and output (15 min)
    3. Lesson: Breaking a problem down into steps (16 min)
    4. Lesson: Flowcharts: symbols and how to read them (16 min)
    5. Lesson: PSeInt: what it is and how to install it on Windows (15 min)
    6. Lesson: Your first algorithm in PSeInt: Escribir and Leer (18 min)
    7. Lab: Fill in: ask and greet in PSeInt (5 min)
    8. Lab: Greeting in PSeInt (10 min)
    9. Lab: Personalized greeting in PSeInt (12 min)
    10. Lesson: Variables and data types in PSeInt (20 min)
    11. Lab: Fill in: the area of a rectangle (5 min)
    12. Lab: Age from the birth year (12 min)
    13. Lab: Profile card with three types (14 min)
    14. Lesson: Operators and expressions in PSeInt (20 min)
    15. Lab: Fill in: the average of two grades (5 min)
    16. Quiz: Check: algorithms and PSeInt (5 min)
    17. Lab: Average of three grades in PSeInt (14 min)
    18. Lab: Discounted price in PSeInt (14 min)
    19. Lab: Biweekly salary with payroll deductions (16 min)
    20. Lab: Temperature conversion: Celsius and Fahrenheit (16 min)
    21. Lab: Area and perimeter of a lot (14 min)
    22. Lesson: Manual tracing: following an algorithm step by step (18 min)
    23. Lab: Swapping the values of two variables (14 min)
    24. Lab: Optional challenge: adult or minor (14 min)
    25. Quiz: Quiz · Chapter 1 (20 min)
  3. Chapter 2 · Bridge to Python (in the full course)

    Make the leap from PSeInt to Python: write, run, and fix your first programs with print, comments, variables, and input.

    1. Lesson: From PSeInt to Python: the same algorithm in another language (15 min)
    2. Lab: Build your first line of Python (5 min)
    3. Lab: Hello, Python: your first translated program (8 min)
    4. Lesson: Where to write Python: DOMLab, Replit, and Google Colab (12 min)
    5. Lesson: Python on your computer: installing Python and VS Code on Windows (20 min)
    6. Lesson: How a Python program is written, and the print() function (15 min)
    7. Lab: A profile card on several lines (10 min)
    8. Lab: The corner store bill with print() (12 min)
    9. Lesson: Comments: notes for people inside the code (10 min)
    10. Lab: A commented recipe: passion fruit juice (10 min)
    11. Lesson: Variables in Python: storing data with the equals sign (15 min)
    12. Lab: Fill in: variables on the card (6 min)
    13. Lab: Luis's details in variables (12 min)
    14. Lab: Pedro's piggy bank: a variable that changes (10 min)
    15. Lesson: input(): the program asks the person a question (15 min)
    16. Lab: Put in order: ask and greet (6 min)
    17. Lab: A personalized greeting with input() (10 min)
    18. Lesson: Converting data: int(), float(), and str() (15 min)
    19. Lab: Fill in: convert what the person types (6 min)
    20. Lab: Adding two whole numbers (10 min)
    21. Lab: Tip calculator (12 min)
    22. Lab: Dominican pesos and dollars converter (14 min)
    23. Lab: Average of three grades in Python (12 min)
    24. Lesson: Reading Python's error messages (15 min)
    25. Lab: Fix the errors: the bus fare (15 min)
    26. Quiz: Quiz · Chapter 2 (15 min)
  4. Chapter 3 · Data types and operators (in the full course)

    Learn the int, float, str, and bool types, calculate with every operator, compare with True and False, and present your results in money format.

    1. Lesson: Data types: int, float, str, and bool (15 min)
    2. Lab: Type detective with type() (10 min)
    3. Lesson: Arithmetic operators, precedence, and parentheses (15 min)
    4. Lab: Fill in: the purchase total (6 min)
    5. Lab: Grocery total at the corner store (14 min)
    6. Lesson: Floor division and remainder: // and % in everyday life (15 min)
    7. Lab: Fill in: minutes and seconds (6 min)
    8. Lab: From seconds to hours, minutes, and seconds (14 min)
    9. Lab: Sharing candies equally (10 min)
    10. Lab: The digits of a three-digit number (12 min)
    11. Lab: Change in bills and coins (15 min)
    12. Lesson: Comparisons: questions that answer True or False (13 min)
    13. Lab: Comparing prices: where is it cheaper? (12 min)
    14. Lesson: The logical operators and, or, and not (13 min)
    15. Lab: Do you qualify for the scholarship? and, or, and not (14 min)
    16. Quiz: Check: types and operators (5 min)
    17. Lesson: Converting without errors and rounding with round() (15 min)
    18. Lab: Seasonal discount with round() (12 min)
    19. Lesson: Well-formatted results: f-strings (15 min)
    20. Lab: Build the line: the total with two decimals (5 min)
    21. Lab: Invoice with 18% ITBIS (15 min)
    22. Lab: Body mass index with formatting (12 min)
    23. Quiz: Quiz · Chapter 3 (15 min)
  5. Chapter 4 · Decisions and validation (in the full course)

    Your programs start making decisions: you'll learn to use if, elif, and else with their indentation, to combine conditions with and, or, and not, and to check the data the person types before using it.

    1. Lesson: Decisions with if: letting the program choose (18 min)
    2. Lab: Put in order: can they vote? (6 min)
    3. Lab: Adult check: your first decision (12 min)
    4. Lesson: if and else: the program picks one of two paths (16 min)
    5. Lab: Fill in the blanks: even or odd (6 min)
    6. Lab: Even or odd (12 min)
    7. Lab: Is your balance enough for the top-up? (15 min)
    8. Lesson: elif: several options and why order matters (18 min)
    9. Lab: Letter grade (15 min)
    10. Lesson: Comparing well: numbers, text, and ranges (16 min)
    11. Lab: Is the corner store open? (12 min)
    12. Lesson: and, or, and not: conditions with several questions (20 min)
    13. Lab: Fill in the blank: username and password (6 min)
    14. Quiz: Check: decisions (5 min)
    15. Lab: Login with username and password (12 min)
    16. Lab: Type of triangle (15 min)
    17. Lab: Leap year (15 min)
    18. Lesson: Validating what the person types (20 min)
    19. Lab: Valid grade: number and range (15 min)
    20. Lab: Calculator with an operator and division by zero (20 min)
    21. Lesson: Rules by ranges: rates, discounts, and bills (18 min)
    22. Lab: Hourly parking rate (15 min)
    23. Lab: Discount based on the purchase amount (15 min)
    24. Lab: Electric bill by usage (15 min)
    25. Quiz: Quiz · Chapter 4 (15 min)
  6. Chapter 5 · Loops and number logic (in the full course)

    You'll make the computer repeat the work for you with while and for, keep track with counters and accumulators, keep asking until you get valid data, and solve the classic number-logic challenges. The First Midterm is waiting for you at the end.

    1. Lesson: Repeat without copying: the while loop (20 min)
    2. Lab: Put in order: count from 1 to 5 (6 min)
    3. Lab: Count up to N with while (12 min)
    4. Lesson: for and range: when you know how many passes (20 min)
    5. Lab: Fill in: the 5 times table (6 min)
    6. Lab: Times table (12 min)
    7. Lab: Even numbers up to N (12 min)
    8. Lesson: Counters and accumulators (20 min)
    9. Lab: Fill in: add up the expenses (6 min)
    10. Quiz: Check: loops (5 min)
    11. Lab: Sum from 1 to N (12 min)
    12. Lab: Expenses for the week (18 min)
    13. Lesson: Sentinels, break, and continue: deciding when to stop (20 min)
    14. Lab: Add up expenses until you type 0 (15 min)
    15. Lesson: Ask for a value until it's correct (20 min)
    16. Lab: Ask for the grade until it's valid (18 min)
    17. Lab: Password with three attempts (18 min)
    18. Lesson: The digits of a number with % and // (18 min)
    19. Lab: Count and add up the digits (15 min)
    20. Lab: Reverse a number (15 min)
    21. Lesson: Logic challenges: factorial and prime numbers (20 min)
    22. Lab: Challenge: factorial of a number (15 min)
    23. Lab: Challenge: is the number prime? (18 min)
    24. Lesson: Logic challenges: perfect numbers and Armstrong numbers (20 min)
    25. Lab: Challenge: perfect number (15 min)
    26. Lab: Challenge: Armstrong number (20 min)
    27. Lesson: Logic challenges: palindromes and the Collatz sequence (20 min)
    28. Lab: Challenge: palindromic number (15 min)
    29. Lab: Challenge: the Collatz sequence (18 min)
    30. Quiz: Quiz · Chapter 5 (15 min)
    31. Exam: First Midterm (90 min)
  7. Chapter 6 · Lists and processing collections (in the full course)

    Store lots of data in a single variable: create lists, add and remove elements, go through them, search, filter, and work out totals, averages, the largest, and the smallest.

    1. Lesson: Lists: many pieces of data in a single variable (18 min)
    2. Lab: Fill in the blank: how many fruits are there? (5 min)
    3. Lab: Your first corner store order in a list (12 min)
    4. Lesson: Positions: reading and changing an element (18 min)
    5. Lab: Fill in the blank: the first and the last grade (5 min)
    6. Lab: First, second, and last in line at the bank (12 min)
    7. Lab: Fix a grade in the record (15 min)
    8. Lesson: Adding and removing elements: append, insert, remove, and pop (20 min)
    9. Lab: Corner store inventory: adding products (15 min)
    10. Lab: To-do list: add, move up, and complete (15 min)
    11. Lesson: Going through a list with for and searching with in (20 min)
    12. Lab: Fill in the blank: adding up the prices in the list (6 min)
    13. Lab: Numbered guest list (15 min)
    14. Lab: Do we have it? Finding a product in the inventory (15 min)
    15. Lesson: Filtering: building a new list with the ones that qualify (15 min)
    16. Lab: Fill in the blank: keeping the passing grades (6 min)
    17. Quiz: Check: lists (5 min)
    18. Lab: Filtering the students who passed (15 min)
    19. Lab: Challenge: shopping list with no duplicates (15 min)
    20. Lesson: Total, average, largest, and smallest: by hand first (20 min)
    21. Lab: The week's expenses: total and average by hand (15 min)
    22. Lab: The business's best and worst day (18 min)
    23. Lesson: Parallel lists: data that goes together (15 min)
    24. Lab: The class's grade record (25 min)
    25. Quiz: Quiz · Chapter 6 (20 min)
  8. Chapter 7 · Functions and debugging (in the full course)

    Teach Python new tasks: define functions with def, give them data with parameters, return results with return, split a big problem into small pieces, and learn to read errors and test your code.

    1. Lesson: Functions: teach Python a new task (20 min)
    2. Lab: Fill in: your first function (5 min)
    3. Lab: Your first function: the corner store sign (12 min)
    4. Lesson: Parameters and arguments: giving data to the function (18 min)
    5. Lab: Build the line: a function with two parameters (6 min)
    6. Lab: Greet each customer by name (12 min)
    7. Lesson: return vs. print: giving back a result (20 min)
    8. Lab: Fill in: return the double (6 min)
    9. Quiz: Check: functions (5 min)
    10. Lab: Area of a lot with return (12 min)
    11. Lab: Is it even? A function that answers True or False (12 min)
    12. Lesson: Local variables: what happens inside the function stays inside (18 min)
    13. Lab: Validate a grade with a function (15 min)
    14. Lab: Average of a list with a function (15 min)
    15. Lesson: Splitting the problem into small functions (18 min)
    16. Lab: Search a list with a function (15 min)
    17. Lab: Filter the prices above a limit (15 min)
    18. Lab: Summary of the expenses in a text (18 min)
    19. Lesson: Reading a traceback: the map of the error (18 min)
    20. Lab: Fix the invoice functions (18 min)
    21. Lesson: Testing and debugging your functions (20 min)
    22. Lab: ask_integer: don't accept invalid data (18 min)
    23. Lab: Challenge: is it prime? with a function (18 min)
    24. Quiz: Quiz · Chapter 7 (20 min)
  9. Chapter 8 · Final applied project (in the full course)

    Plan, build step by step, test, improve, and present a complete program with a menu, functions, validation, loops, and lists.

    1. Lesson: Planning the final project: from problem to plan (22 min)
    2. Lesson: Designing a menu that repeats with while True (22 min)
    3. Lab: Piggy bank with a menu: deposit, withdraw, and view the balance (18 min)
    4. Lesson: Organizing the project into functions (22 min)
    5. Lab: Expenses 1 · The expense tracker menu (18 min)
    6. Lesson: Bulletproofing the project: validating every piece of data that comes in (22 min)
    7. Lab: Expenses 2 · Adding an expense with validation (22 min)
    8. Lab: Expenses 3 · Viewing the expense list (20 min)
    9. Lab: Expenses 4 · Total and average of the expenses (20 min)
    10. Lab: Expenses 5 · The largest expense and the summary on exit (22 min)
    11. Lesson: Testing the project before you hand it in (22 min)
    12. Lab: Expenses 6 · Test and fix the expense tracker (22 min)
    13. Lesson: Improving the code: names, messages, and structure (20 min)
    14. Lab: Improve the corner store sales program (25 min)
    15. Lesson: How your project is graded: the rubric with examples (20 min)
    16. Lesson: Adapting the plan to other projects (22 min)
    17. Lab: Alternate project · Basic corner store inventory (45 min)
    18. Lab: Alternate project · High school grade record (45 min)
    19. Lab: Alternate project · To-do list (45 min)
    20. Lab: Alternate project · Library loans (45 min)
    21. Lab: Alternate project · Class attendance tracker (45 min)
    22. Lab: Alternate project · Contact book (45 min)
    23. Lesson: Presenting and explaining your solution (20 min)
    24. Quiz: Quiz · Final review (20 min)

Before you start

  • You don't need to know how to program or have any experience with computers: Chapter 0 teaches you the basics.
  • A Windows computer with an Internet connection.
  • A modern browser: Chrome, Edge or Firefox.

Try the first lesson for free, no account needed

Also in: Español