Carnegie Mellon Quality. Learn for free.
The last coding course you'll ever need
Programming for Lovers is an open course where you write code to answer real scientific questions, built on award-winning teaching from Carnegie Mellon University.
Table of Contents
Ancient Greek Math and The Foundations of Computer Science
Algorithms are the building blocks of computer science. We'll explore two beautiful mathematical algorithms from ancient Greece, introduce pseudocode, and implement and time these algorithms in code.
Chapter 0
Hunting for Hidden Messages in Bacterial Genomes
Every organism on Earth has a genome made of nucleotides — letters from the four-symbol alphabet {
A, C, G, T}. How can we find hidden messages lurking within DNA? Even simple algorithms can reveal deep insights into the life of a bacterium.
Chapter 1
Forecasting a Presidential Election
Monte Carlo simulation uses randomness across many trials to estimate outcomes. We'll apply this technique to simulate the 2016 US presidential election from polling data — and reflect on the pitfalls of forecasting.
Chapter 2
Discovering a Self-Replicating Automaton
Researchers have yet to build a robot that can both perform complex tasks and replicate itself — yet the theoretical foundations are decades old. We'll explore cellular automata and the Game of Life, then build an automaton capable of self-replication.
Chapter 3
Building a Gravity Simulator with Object-Oriented Programming
We'll introduce object-oriented programming and abstraction, then simulate how a small universe of bodies moves under Newtonian gravity by exploring the three-body problem.
Chapter 4
Evolutionary Trees and More Object-Oriented Programming
We'll deepen our understanding of object-oriented programming by implementing UPGMA, one of the most famous algorithms for constructing evolutionary trees.
Chapter 5
Watch Our Intro Video
Hear From Our Learners
P4❤️ creatively combines the foundations of coding with a scientific twist! It paved the way for my future as a computational biologist.
SarahMaster's Student
Having access to well-written material and hands-on coding videos within the same resource is fantastic, and now everyone with access to the internet has this privilege. “Go” ahead and use it!
BengisuMolecular Biologist
P4❤️ helped me make the leap from spaghetti code to a systematic problem-solving approach for programming.
BenUndergraduate Student
P4❤️ incrementally builds your knowledge, with each chapter using engaging questions that push your abilities, teaching you to solve complex problems systematically.
EthanMaster's Student
With excellent videos and fascinating scientific applications, P4❤️ is impossible not to love.
ChatalHigh School Student