In 2007 we switched our CS1 course to Python from C++. In 2012 we switched from Python2 to Python3. We have now accumulated many programming projects (over 100 at last count), and thought that it would benefit the CS1 Python community to share them. Solutions are here, but we haven't figured out the best way to share them.

This archive is organized on the order that we cover topics. File reading is built into projects early. Our programming projects generally take one week so we do ten or eleven in a semester—skipping exam weeks.

We would like to have others add to this collection. That is, open it up so that it isn't our material, but everyone's material. When we find a suitable forum that allows easy uploads for sharing we will do so. Therefore, this is a temporary location.

If you find problems with this page, email us.

William Punch and Richard Enbody, The Practice of Computing Using Python, 2nd. Ed

- Beginnings: a set of simple projects when you have little to work with.
- First Steps -- little to work with.
- Richter Scale: Input some numbers, do some simple arithmetic, output results.(Python3)
- Windchill: Input some numbers, do some simple arithmetic, output results.(Python3)
- Arithmetic: Input some numbers, do some simple arithmetic, output results.
- Gasoline: Input some numbers, do some simple arithmetic on gas and oil quantities, output results.
- Measurement: Input some numbers, do some simple arithmetic to do silly conversions such as furlongs/fortnight, output results.
- Population: Input some numbers, do some simple arithmetic to estimate today's U.S. population, output results.
- Time Travel: Input some numbers, do some simple arithmetic to calculate travel time between stars, output results.
- Debt : Calculate the height of a stack of bills based on the national debt. .
- Simple Programs.
- Number Puzzle: Slayer: Check solutions for a number-word puzzle.
- Garden, Garden2: Calculate plantings and mulch for a garden. (Python3)
- Einstein: Solve a simple number puzzle attributed to Einstein.
- MacArthur: Solve a simple number puzzle attributed to MacArthur.
- Tones: Calculate frequencies to generate tones on a computer speaker.
- Turtle Graphics Angles: Use Turtle Graphics to draw two lines and the calculate the angle between them.
- NinetyNine : Simple number game.
- Control: With selection and repetition we can begin to do something.
- Draw : Draw regular patterns using TurtleGraphics. (Python3)
- Making Change : Making change.
- Number Puzzle: SplitNumber: Split numbers into increasing sequences, e.g. 154152 -> 15, 41, 52. (Python3)
- WaterBilling: Calculate water bills based on category and useage. (Python3)
- CarRental: Calculate rates for a car rental agency based on category and mileage. (Python3)
- Trig: Implement basic trigonometric functions using power series. (Python3)
- LatinSquares: Input two numbers: order and start. Build a Latin square of that order with that starting number.
- Number Theory: Persistence: Numbers can have interesting properties. Here we look at additive persistence where you sum the digits of a number and then sum the digits of the sum—continue until you get a single digit.
- Number Theory: Pologinal: The ancient Greeks found number properties to be interesting. A pologinal number is a particular geometric arrangement of a number of balls. Here we find two triangular number that form a given square number.
- Ancient Egyptian Multiplication: Weird Multiplication: To muliply A by B repeatedly multiply A by 2 while dividing B by 2 until the division has a remainder. If B becomes odd, add A to it. Sum the resulting A and B.
- Calculator: Make a simple, basic arithmetic calculator. Accept an expression in the form "number operator number", and calculate the result.
- Bank File Processing: Read a file of banking transactions and keep a ledger. (Python3)
- Working With Strings.
- Gibberish : Generate gibberish from English according to a particular pattern. (Python3)
- WHO_Measles : Given a file of World Health Organization raw data, answer queries such as "what is the vaccination level for Measles in Africa?" (Python3)
- Matching DNA : Simple DNA sequence matching.
- Palindomic Integers: Use the 196-algorithm to construct palindomic integers starting from any integer.
- Number-Guessing Game: Create a number-guessing game that provides hints on the number and position of correct digits in the guess (similar to Mastermind).
- Hangman: Create a hangman game (without the graphics of the hangman itself).
- Mastermind: Create a Mastermind game.
- Caesar Cypher: Encode and decode strings using a Caesar cypher.
- Shannon's Throbac: For fun Claude Shannon built a machine to do Roman Numeral arithmetic. We simulate it.
- Rock Paper Scissors: Create a game of Rock-Paper-Scissors.
- Functions (simple)
- Flag: Draw the American flag using TurtleGraphics. (Python3)
- Tesselations: Tile a plane using TurtleGraphics.
- StringLibrary: Implement a library of string functions (not using the built-in string functions). (Python3)
- WeFeelFine: Use functions from a module to gather data for analysis from the "We Feel Fine" page. The result is a collection of people's feelings scraped from blogs.
- GDP vs. Employment: Using GDP and employment data from the web, prompt for a year and provide the data for that year.
- Scrambled Words: Research shows that scrambled words can be read if the first and last letter are not changed, e.g. "Elingsh uinervtisy." Read in a file and scramble the words except first letters, last letters, and punctuation.
- Cracking a Caesar Cipher: Decrypt Caesar Ciphers using letter frequencies.
- Lists and Tuples
- Risk: Analyze Center for Disease Control data on health risks. (Python3)
- Bestsellers: Answer queries about bestsellers such as "What were the bestsellers in 2008?". (Python3)
- Venus: Determine suitable craters for mining on Venus using NASA data. (Python3)
- Baseball: Answer queries about a baseball season such as "list the players with the top 8 batting averages." (Python3)
- Apple Stock : Given a log file of Apple stock prices, calculate some simple statistics.
- Scrambled English: Scramble English words into a scrambled, but readable, form. (Python3)
- Basketball: Who is best basketball player in the NBA? Get data from the web and analyze it.
- Latin: Search for Latin roots, suffixes, and prefixes in a file.
- Anagrams: Given a word find all the anagrams of that word in a word list.
- Data Mining: Data Mining of online Google stock data.
- Build Query to Search Files: Build a simple query to search files ignoring stop words.
- Equity: Calculate Return on Equity (ROE) for stocks in a data file.
- Build HTML: Build HTML files from a database of information.
- Sunspots: Using NOAA data from the web analyze sunspot data to predict the next sunspot peak.
- Pascal's Triangle: Construct Pascal's Triangle to a specified depth.
- Auto Mileage: Using online data on automobiles, gather engine size and mileage data. Use least squares to find a linear regression and correlation. Graph it.
- Packaging: Minimize the amount of cardboard used to box a set of glasses with specified dimensions.
- Dictionaries and Sets
- Document Retrieval: Build a simple document retrieval system. (Python3)
- Poverty: Use US Census county data for MI to answer queries such as what is the poverty rate for children in a particular county. (Python3)
- Wikipedia: Parse a Wikipedia log file and respond to queries such as "who edited the most articles?" (Python3)
- TagCloud2: Build a tag cloud of a 2012 presidential debate. (Python3)
- WordCompletion: Simple word completion.
- TagCloud: Build a tag cloud of the 2008 vice-presidential debates.
- Movies & Actors: Using the online Internet Movies DataBase build a dictionary of movies and actors. Given two movies find all the actors in the movies (AND), find the common actors in the movies (OR), find the actors in either movie but not both (EXCLUSIVE_OR). Given an actor, find all the co-actors that actor has acted with.
- BMI: Body Mass Index: Using real data from the Internet on a set of people, calculate their BMI, and then use least squares to find a linear regression and correlation. Extra credit: graph it.
- Breast Cancer Classifier: Build a cancer classifier from breast cancer study data to predict if a given cancer is malignant or not.
- Income Classifier: Build an income classifier from individuals' characteristics (over 30K records from the Internet) to predict if the individual's income will be greater than $50K or not.
- Vocabulary Quiz: Build a vocabulary quiz program.
- Concordance: Build a simple concordance.
- Sunspots: Determine cycles in sunspot data (data goes back to 1749).
- SpellCheck: Build a file spell checker that includes suggestions.
- Natural Language Processing: Calculate unigrams and bigrams in a text file.
- Natural Language Processing II: Create Markov chains from a given text and then use the chains to create new text.
- Classes: using instructor-designed classes to prepare for designing classes. We have found solitaire to be an excellent medium: we provide card and deck classes; students build a game. There are numerous variations on solitaire: e.g. World Of Solitaire.
- FreeCell: Solitaire. (Python3)
- CanField: Solitaire.
- SeaHaven: Solitaire. (Python3)
- TexasHoldM: Poker. (Python3)
- BlackJackSquare: Solitaire with blackjack-style scoring.
- EastHaven: A solitaire variation where cards from the stock go to all tableau columns.
- Golf Relaxed: Another solitaire variation.
- Aces Up: A solitaire variation that is a kids game.
- Spider: Yet, another solitaire variation.
- Class Design
- Currency : Currency calculator based on queries to Google for the latest rates. (Python3)
- GoogleMap : Query Google Maps to get a route between cities. (Python3)
- TurtleSnowPeople : Create a set of classes of graphical components for snow people. (Python3)
- Flags : Create a set of classes of graphical components for Flags. (Python3)
- Quadrilaterals : Given an outline of a class, fill in the details. (Python3)
- YouTube : Design classes to support using the Google API to make queries on YouTube.
- Triangles : Given an outline of a class, fill in the details. (Python3)
- Elevator Simulator: Create three classes (Building, Elevator, and Customer) to use in simulating an elevator.
- Face Drawing Program: Create five classes of facial features (using Turtle Graphics) and build a face drawing tool around them.
- Minesweeper: Create a Minesweeper class and design a Minesweeper game around it.
- Protein Transcription: Create a transcriber class so you can take in a sequence of DNA bases, use a mapping of amino acids to codons, and yield a sequence of amino acids.
- Queue Simulation: There are four ATM machines in the student union. Should students form one queue or four? Create an event class and build an event-driven simulation around that class. Use the simulator to answer the question.
- Game of Life: Create a class for the Game of Life and then build the game around it.
- Traveler's Dilemma: Write a program that plays the Travler's Dilemma using at least one class and one exception. Test your game with ten different pairs of people. Analyze the results.
- Dilbert's Carpet Fishing: A Dilbert cartoon has him playing an office game he calls "Carpet Fishing." Using at least one class, write the game.
- Turtle Classes: Create a set of classes of graphical components of your own design for use in creating a TurtleGraphics picture of your own design.
- Dating Service : Create a dating service with your own matching algorithm supported by classes of your own design.
- Dominos: Create a Dominos game supported by classes of your own design.
- TurtleCar: Create a library of classes to support drawing a car using Turtle graphics.

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.