Python for Beginners: Introduction to Programming

Free online course · Beginner · 10 lessons

Learn to write, run and debug Python programs with variables, conditions, loops, functions, lists, dictionaries, files and a first look at classes. After the course you can automate small tasks and read beginner-level code with confidence.

By Studeli

Start with lesson 1

Is this Python course for you?

Who it is for

You have never programmed, or you tried once and want a structured first course in a general-purpose language.

What you will learn in 10 lessons

Every lesson includes all nine study tools

  • Study Guide
  • Summary
  • Walkthroughs
  • Practice Questions
  • Flashcards
  • Explain It
  • Key Terms
  • Cheat Sheet
  • Concept Map
  1. Write and run short Python programs that store values in variables, combine them with operators and read input from the user.

    5 learning goals
    1. 1.Run Python programs and read what they tell you
    2. 2.Work with values and their types
    3. 3.Store and update values in variables
    4. 4.Calculate with operators and expressions
    5. 5.Get input, convert types and show results
  2. Make programs choose between actions with if, elif and else, combining comparisons with Boolean operators.

    5 learning goals
    1. 1.Compare values to get True or False
    2. 2.Make programs choose with if, elif and else
    3. 3.Combine conditions with Boolean logic
    4. 4.Structure and test more complex decisions
    5. 5.Choose among cases with match statements
  3. Repeat work with while and for loops, and apply common loop patterns such as counting, accumulating and searching.

    6 learning goals
    1. 1.Repeat actions with while loops
    2. 2.Step through sequences with for loops and range
    3. 3.Control a loop with break, continue and else
    4. 4.Use standard loop patterns
    5. 5.Write nested loops
    6. 6.Trace and debug loops
  4. Define functions with parameters and return values, and break a program into small, reusable, well-named pieces.

    5 learning goals
    1. 1.Define and call your own functions
    2. 2.Pass information into functions
    3. 3.Send results back with return values
    4. 4.Know where variables live: local and global scope
    5. 5.Document and design programs with functions
  5. Manipulate text with indexing, slicing, string methods and f-strings, and format output for users.

    5 learning goals
    1. 1.Create strings and pick out their parts
    2. 2.Process strings character by character
    3. 3.Transform, search and test text with string methods
    4. 4.Split text into parts and join parts into text
    5. 5.Format output with f-strings
  6. Store and process sequences of values with lists and tuples, and explain how mutability and aliasing affect a program.

    6 learning goals
    1. 1.Store values in lists and reach them by position
    2. 2.Change lists with methods and assignment
    3. 3.Process lists with loops
    4. 4.Use tuples and unpacking
    5. 5.Explain mutability, aliasing and copying
    6. 6.Sort lists and other sequences
  7. Use dictionaries to look up, count and group data by key, and use sets to remove duplicates and compare collections.

    5 learning goals
    1. 1.Store and look up data with dictionaries
    2. 2.Loop through dictionaries and build new ones
    3. 3.Count and group data with dictionaries
    4. 4.Model structured data with nested dictionaries
    5. 5.Use sets to remove duplicates and compare collections
  8. Read and write text and CSV files, and handle errors with try and except so programs fail gracefully.

    5 learning goals
    1. 1.Read and write text files
    2. 2.Find files with paths
    3. 3.Read and write CSV files
    4. 4.Handle errors with try and except
    5. 5.Raise your own exceptions
  9. Import standard-library and installed modules, find bugs with a systematic debugging process and check functions with simple tests.

    4 learning goals
    1. 1.Use modules from the standard library, your own files and PyPI
    2. 2.Read tracebacks and error messages
    3. 3.Find and fix bugs systematically
    4. 4.Check functions with assertions and unit tests
  10. Define classes with attributes and methods, create objects from them and explain when bundling data and behavior makes a program clearer.

    5 learning goals
    1. 1.Understand objects and define your first class
    2. 2.Set up objects with constructors and attributes
    3. 3.Give objects behavior with instance methods
    4. 4.Use special methods so objects print and compare well
    5. 5.Build programs from objects that work together

What to take next

More Programming courses

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started