Skip to content

Python Fundamentals

Free

Python syntax, control flow, data structures, functions, error handling, and OOP — run live in-browser via Pyodide.

6 modules · Free with a (free) account.

View the full course

What this course covers

A module-by-module concept outline. Open the course to learn each topic with animated explanations, in-browser code, practice challenges, and a knowledge check.

Module 1. Core Syntax - The Building Blocks

Topics
Why Python for Data ScienceVariables & AssignmentData Types (int, float, str, bool)Basic OperationsComments & Code Style
Sections
  1. 1Why Python & Getting Started
  2. 2Variables - Labeled Boxes for Data
  3. 3Data Types - The Four Essentials
  4. 4Operators - Making Python Calculate
  5. 5Comments & Code Style

Module 2. Control Flow - Making Decisions

Topics
Boolean Logic & Comparisonsif/elif/else Statementsfor Loopswhile Loopsbreak, continue, pass
Sections
  1. 1Boolean Logic & Comparisons
  2. 2if/elif/else - Making Decisions
  3. 3for Loops - Iterating Over Data
  4. 4while Loops - Condition-Based Repetition
  5. 5Loop Control: break, continue, pass

Module 3. Data Structures - Organizing Information

Topics
Lists - Ordered CollectionsTuples - Immutable SequencesDictionaries - Key-Value PairsSets - Unique CollectionsList Comprehensions
Sections
  1. 1Lists - Ordered, Mutable Collections
  2. 2Tuples - Immutable Sequences
  3. 3Dictionaries - Key-Value Lookup
  4. 4Sets - Unique Elements
  5. 5List Comprehensions - Pythonic Shortcuts

Module 4. Functions - Reusable Code Blocks

Topics
Defining FunctionsParameters & ArgumentsReturn ValuesScope & NamespacesLambda & Higher-Order FunctionsRecursionDocstrings & Type HintsClosuresDecorators
Sections
  1. 1Defining Functions - The Basics
  2. 2Parameters & Arguments
  3. 3Return Values
  4. 4Scope & Namespaces
  5. 5Lambda & Higher-Order Functions
  6. 6Recursion
  7. 7Docstrings & Type Hints
  8. 8Closures
  9. 9Decorators

Module 5. Error Handling & File I/O

Topics
Exceptions & Error Typestry/except/finallyRaising ExceptionsReading & Writing FilesWorking with CSV & JSON
Sections
  1. 1Why Errors Happen - Exception Types
  2. 2try/except - Catching Errors Gracefully
  3. 3finally & else - Cleanup & Success Paths
  4. 4Raising Exceptions - Failing on Purpose
  5. 5Reading & Writing Text Files
  6. 6Working with CSV Data
  7. 7JSON - The Universal Data Format

Module 6. Object-Oriented Programming

Topics
Classes & Objects__init__ & selfAttributes & MethodsInheritance & EncapsulationMagic Methods (Dunder)Polymorphism & Duck TypingMultiple Inheritance & MROAbstract Base ClassesDataclassesWhen to Use OOP vs Functions
Sections
  1. 1Why OOP? - The Blueprint Metaphor
  2. 2Classes & Objects - Creating Blueprints
  3. 3__init__ & self - Initialization
  4. 4Methods - Functions Inside Classes
  5. 5Inheritance - Building on Existing Classes
  6. 6Encapsulation & Properties
  7. 7Magic Methods - Python's Secret Protocols
  8. 8Polymorphism - Same Interface, Different Behavior
  9. 9Multiple Inheritance & MRO
  10. 10Abstract Base Classes (ABCs)
  11. 11Dataclasses - Less Boilerplate
  12. 12When to Use OOP vs Functions

Ready to start Python Fundamentals?

Free with a (free) account — sign in and start learning.

Go to the course