CS1 Python Programming Projects Archive
In 2007 we switched our CS1 course to Python from C++.
We have now accumulated many programming projects, 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 semesterskipping 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
- Beginnings: a set of simple projects when you have little to work with.
- First Steps -- little to work with.
- 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.
- Simple Programs.
Solve a simple number puzzle attributed to Einstein.
Solve a simple number puzzle attributed to MacArthur.
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.
- Turtle Graphics Polygon:
Use Turtle Graphics to draw a polygon and fill it in with a color.
- Control: With selection and repetition we can begin to do something.
Input a number and a digit; count occurrences of the digit in the number.
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 sumcontinue 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.
Make a simple, basic arithmetic calculator. Accept an expression in the form "number operator number", and calculate the result.
- Working With Strings.
- 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).
Create a hangman game (without the graphics of the hangman itself).
Create a Mastermind game.
- Caesar Cypher:
Encode and decode strings using a Caesar cypher.
- Rock Paper Scissors:
Create a game of Rock-Paper-Scissors.
- Functions (simple)
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
Who is best basketball player in the NBA? Get data from the web and analyze it.
Search for Latin roots, suffixes, and prefixes in a file.
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.
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.
Minimize the amount of cardboard used to box a set of glasses with specified dimensions.
- Dictionaries and Sets
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.
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.
Solitaire with blackjack-style scoring.
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.
Yet, another solitaire variation.
- Class Design
- 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.
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.
Create a Dominos game supported by classes of your own design.
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.