‹ All courses

AP Computer Science Principles (Python)

A free AP CSP curriculum in Python, with slides, labs, and projects.

966 interactive problems.

New: Teachers can now log in, enroll their students, and assign problem sets that follow the AP CSP curriculum. Live coding problems and a full Python IDE are included. The IDE has a dedicated Create Task workspace where students write, run, and save their Create Performance Task program.

This is a resource for teachers and students for AP Computer Science Principles. This curriculum is being updated for newly revised 2020-21 College Board curriculum. The official language for the course is Python.

Course Outline and Lecture Notes

Introduction to Programming with Python

We will cover the essentials of the Python language: data types, conditionals, loops, basic data structures including lists, tuples and dictionaries, functions, object-oriented programming and inheritance.

The Create Task

The Create Task(PPT, PDF)

Computer Science Principles

We will cover general computer science principles here.

Interesting Short Projects/Applications in Python

Computer Animation with Processing

We will introduce computer graphics using Processing.

Processing Python TemplateZIP — Processing Python Template
Create and Control Sprites LabZIP — Create and Control Sprites Lab
Pick Up Coins LabZIP — Pick Up Coins Lab
Tank Shoots Bricks LabZIP — Tank Shoots Bricks Lab
Top-Down Games CollisionZIP — Top-Down Games Collision

Processing Labs

Intro Processing LabZIP — Intro Processing Lab
Growing Circle LabZIP — Growing Circle Lab
Bouncing Ball LabZIP — Bouncing Ball Lab
Paddle and Ball LabZIP — Paddle and Ball Lab
Capture the FlagsZIP — Capture the Flags
Creating a 2D Map of SpritesZIP — Creating a 2D Map of Sprites
AI: Eight Puzzle SolverZIP — AI: Eight Puzzle Solver

How to write a very simple platformer game!

This material uses Processing. Review the Processing lecture notes and labs(see above) before attempting this lab. The two video tutorials were created for my APCSA(Java) class but they discuss the math behind the algorithms and are language agnostic.

1.How to Resolve Platform CollisionsYoutube — How to Resolve Platform Collisions
Platformer Game LabZIP — Platformer Game Lab

Text Processing: Analyzing Shakespeare

A short problem set and tutorial on how to perform a simple word frequency analysis: total words, total unique words and most frequently used words in all of Shakespeare's collection of works. (HTML, ZIP)

Additional Topics

Introduction to Neural Networks

A 2-3 weeks curriculum designed for AP Computer Science Principles on Neural Networks. Students will implement from scratch a Python program that recognizes handwritten digits! The full course resources page can be found here.

Introduction to the Discrete Fourier Transform

This course explains the math behind the Discrete Fourier Transform and illustrates its utility through analyzing and manipulating audio files in Python. The full course resources page can be found here.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.