‹ All courses

AP Computer Science Principles (Python)

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

884 interactive problems, free to use.

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.

1.Basic DatatypesPPTPDF
2.Operations and VariablesPPTPDF
3.ConditionalsPPTPDF
Animation with ProcessingPPTPDF
Intro Processing LabZIP
Growing Circle LabZIP
Bouncing Ball LabZIP
4.FunctionsPPTPDF
Paddle and Ball LabZIP
Capture A FlagZIP
5.For Loops and StringsPPTPDF
6.ListsPPTPDF
Capture the FlagsZIP
7.While, Nested Loops and List of TuplesPPTPDF
List of CirclesZIP
8.Object-Oriented ProgrammingPPTPDF
Intro OOP LabZIP
Control Sprite By KeyboardZIP
Creating a 2D Map of SpritesZIP
9.AlgorithmsPPTPDF
Top-Down Games CollisionZIPSlides PDF
Breadth-First SearchPPTPDF
AI: Eight Puzzle SolverZIP
Text Processing: Analyzing ShakespearetxtHTMLZIP
Luhn's Algorithm: Validity of Credit Card NumbersPPTPDF
10.(optional)Tuples and DictionariesPPTPDF
11.(Optional)An Introduction to Jupyter NotebookPPTPDF
12.(Optional)An Introduction to NumpyPPTPDF
13.(Optional)pandas for Tabular DataPPTPDF

The Create Task

The Create Task(PPT, PDF)

Computer Science Principles

We will cover general computer science principles here.

1.Understanding Data 1: Representing Data DigitallyPPTPDF
2.Understanding Data 2: Images and CompressionPPTPDF
Image Processing LabZIPColab
3.Understanding Data 3: Extracting Information from DataPPTPDF
Intro Exploratory Data Analysis with PandasZIPonline notebook(MyBinder)
4.Securing Data: CryptographyPPTPDF
5.The Internet: An Introduction to NetworkingPPTPDF
6.Impact of ComputingPPTPDF
7.(Optional)Digital Audio Processing with Python: Part 1: Audio BasicsPPTPDF
8.(Optional)Digital Audio Processing with Python: Part 2: The Discrete Fourier TransformPPTPDF
(Optional)Discrete Fourier Transform LabZIPonline notebook(MyBinder)
9.(Optional)Machine LearningPPTPDF
10.(Optional)Reinforcement LearningPPTPDF
AP Exam PreparationPPTPDF

Interesting Short Projects/Applications in Python

Computer Animation with Processing

We will introduce computer graphics using Processing.

1.Introduction to Processing(Python Version)PPTPDF
Processing Python TemplateZIP
2.Keyboard and Mouse InputsPPTPDF
3.Working with SpritesPPTPDF
Create and Control Sprites LabZIP
4.Collision DetectionPPTPDF
Pick Up Coins LabZIP
Tank Shoots Bricks LabZIP
5.Resolving Top-Down CollisionPPTPDF
Top-Down Games CollisionZIP

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
2.How to JumpYoutube
Platformer Game LabZIP

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.