Skip to main content
Primary: Phase 0Full CourseBeginnerFree Learning Material
Harvard University

CS50's Introduction to Programming with Python

A comprehensive introduction to Python programming, covering functions, variables, control flow, exceptions, libraries, unit testing, file I/O, and object-oriented programming.

Taught by Professor David J. Malan, Harvard CS50P is a rigorous, beginner-accessible university course dedicated entirely to the Python language. Through ten weeks of lectures and hands-on problem sets, learners build fluency in writing clean functions, handling runtime exceptions, testing code with pytest, manipulating files, using regular expressions, and designing object-oriented classes—the exact software engineering habits needed before tackling machine learning algorithms.

Resource Tracking

Course status is tracked independently from roadmap topic checkboxes so you can mark external courses without altering your topic mastery percentage.

Suggested Learning Position

Phase 0 Primary Starting Course (Modules 0.1, 0.2 & 0.4)

Documented Duration:10 weeks (self-paced)
Language:English
Access & Link Verification

All video lectures, course notes, slides, source code, and problem sets are 100% free and openly accessible on Harvard's OpenCourseWare site.

Certificate Note: Harvard CS50 offers a free certificate upon completing required problem sets via CS50.me; verified edX certificates are optional and paid.

Status: Verified (2026-11-09)

What You Will Learn from This Resource

  • Write modular Python programs using functions, conditionals, loops, and comprehensions.
  • Handle exceptions gracefully and write automated unit tests with pytest.
  • Read and write structured text/CSV files and design object-oriented classes.

Recommended Prerequisites

Review these foundations before starting so you get the most out of this material:

  • No prior programming experience required; basic computer literacy.

Topics & Keywords

PythonCS50PUnit TestingOOPFile I/OProgramming Foundations
Curriculum Integration

How This Resource Fits Into Your AI & LLM Roadmap

Open Interactive Roadmap

Phase-Specific Study Recommendations (1)

Phase 0 · Resource 0.1Start Here · Recommended

CS50's Introduction to Programming with Python

In Phase 0: Programming Foundations

Start here for Phase 0. Complete Weeks 0–8 and solve the programming problem sets to build rock-solid Python syntax, debugging, pytest unit testing, and object-oriented design fluency.

Continue Exploring
Browse Full Library
Phase 0Full Course
University of Michigan / Dr. Charles Severance
BeginnerFree Learning Material

Python for Everybody

Beginner-friendly Python instruction covering programming fundamentals, data structures, files, web data, and databases.

PythonData StructuresDictionariesBeginner Python
Your Status:
Phase 0Documentation / Tutorials
NumPy
BeginnerFree Learning Material

NumPy Learning Resources

Learn numerical arrays, broadcasting, vectorized computation, matrix operations, and scientific Python fundamentals.

NumPyVectorsMatricesBroadcastingVectorization
Your Status:
Phase 2Full Course
Harvard University
IntermediateFree Learning Material

CS50's Introduction to Artificial Intelligence with Python

University course exploring the foundational concepts and algorithms of modern artificial intelligence, including search, optimization, machine learning, neural networks, and natural language processing.

HarvardCS50 AIMachine LearningOptimizationPython
Your Status: