Five mini programming projects for the Python beginner

After Shelly wrote this post, Webucator, a company that provides Python training, volunteered to create solutions for these projects. They've made a series of videos that'll help you out if you need it.

Learning a new programming language is both the most exciting and the most humbling experience. For me, that language has recently been Python, which I’ve been learning over these last few months. And as every coder knows, the best way to learn a language is to apply it in a project. But what happens when you don’t have a giant, ambitious project? For me, that’s where the sandbox comes in. Why not build a few sandcastles before piling up the rocks to our grand ol’ castle?

With that in mind, here are five mini programming projects to get you started on learning Python. The exact solutions aren’t here — that’s where the most important learning comes into play — but there are hints as to the concepts that you should be using. And remember, Google is your friend!

1. Dice Rolling Simulator

The Goal: Like the title suggests, this project involves writing a program that simulates rolling dice. When the program runs, it will randomly choose a number between 1 and 6. (Or whatever other integer you prefer — the number of sides on the die is up to you.) The program will print what that number is. It should then ask you if you’d like to roll again. For this project, you’ll need to set the min and max number that your dice can produce. For the average die, that means a minimum of 1 and a maximum of 6. You’ll also want a function that randomly grabs a number within that range and prints it.

Concepts to keep in mind:

  • Random
  • Integer
  • Print
  • While Loops


A good project for beginners, this project will help establish a solid foundation for basic concepts. And if you already have programming experience, chances are that the concepts used in this project aren’t completely foreign to you. Print, for example, is similar to Javascript’s console.log.

2. Guess the Number

The Goal: Similar to the first project, this project also uses the random module in Python. The program will first randomly generate a number unknown to the user. The user needs to guess what that number is. (In other words, the user needs to be able to input information.) If the user’s guess is wrong, the program should return some sort of indication as to how wrong (e.g. The number is too high or too low). If the user guesses correctly, a positive indication should appear. You’ll need functions to check if the user input is an actual number, to see the difference between the inputted number and the randomly generated numbers, and to then compare the numbers.

Concepts to keep in mind:

  • Random function
  • Variables
  • Integers
  • Input/Output
  • Print
  • While loops
  • If/Else statements


Jumping off the first project, this project continues to build up the base knowledge and introduces user-inputted data at its very simplest. With user input, we start to get into a little bit of variability.

3. Mad Libs Generator

The Goal: Inspired by Summer Son’s Mad Libs project with Javascript. The program will first prompt the user for a series of inputs a la Mad Libs. For example, a singular noun, an adjective, etc. Then, once all the information has been inputted, the program will take that data and place them into a premade story template. You’ll need prompts for user input, and to then print out the full story at the end with the input included.

Concepts to keep in mind:

  • Strings
  • Variables
  • Concatenation
  • Print


A pretty fun beginning project that gets you thinking about how to manipulate userinputted data. Compared to the prior projects, this project focuses far more on strings and concatenating. Have some fun coming up with some wacky stories for this!

4. TextBased Adventure Game

The Goal: Remember Adventure? Well, we’re going to build a more basic version of that. A complete text game, the program will let users move through rooms based on user input and get descriptions of each room. To create this, you’ll need to establish the directions in which the user can move, a way to track how far the user has moved (and therefore which room he/she is in), and to print out a description. You’ll also need to set limits for how far the user can move. In other words, create “walls” around the rooms that tell the user, “You can’t move further in this direction.”

Concepts to keep in mind:

  • Strings
  • Variables
  • Input/Output
  • If/Else Statements
  • Print
  • List
  • Integers


The tricky parts here will involve setting up the directions and keeping track of just how far the user has “walked” in the game. I suggest sticking to just a few basic descriptions or rooms, perhaps 6 at most. This project also continues to build on using userinputted data. It can be a relatively basic game, but if you want to build this into a vast, complex word, the coding will get substantially harder, especially if you want your user to start interacting with actual objects within the game. That complexity could be great, if you’d like to make this into a longterm project. *Hint hint.

5. Hangman

The Goal: Despite the name, the actual “hangman” part isn’t necessary. The main goal here is to create a sort of “guess the word” game. The user needs to be able to input letter guesses. A limit should also be set on how many guesses they can use. This means you’ll need a way to grab a word to use for guessing. (This can be grabbed from a pre-made list. No need to get too fancy.) You will also need functions to check if the user has actually inputted a single letter, to check if the inputted letter is in the hidden word (and if it is, how many times it appears), to print letters, and a counter variable to limit guesses.

Concepts to keep in mind:

  • Random
  • Variables
  • Boolean
  • Input and Output
  • Integer
  • Char
  • String
  • Length
  • Print


Likely the most complex project on this list (well, depending on just how intense you went with the adventure text game), the Hangman project compiles the prior concepts and takes them a step further. Here, outcomes are not only determined based on user-inputted data, that data needs to be parsed through, compared, and then either accepted or rejected. If you want to take this project a step further, set up a hangman image that changes!

About the author

Shelly Tan

Undergraduate Fellow

Tagged

Latest Posts

  • How We Brought A Chatbot To Life

    Best Practice Guide

    A chatbot creates a unique user experience with many benefits. It gives the audience an opportunity to ask questions and get to know more about your organization. It allows you to collect valuable information from the audience. It can increase interaction time on your site. Bot prototype In the spring of 2017, our Knight Lab team examined the conversational user interface of Public Good Software’s chatbot, which is a chat-widget embedded within media partner sites.......

    Continue Reading

  • Stitching 360° Video

    For the time-being, footage filmed on most 360° cameras cannot be directly edited and uploaded for viewing immediately after capture. Different cameras have different methods of outputting footage, but usually each camera lens corresponds to a separate video file. These video files must be combined using “video stitching” software on a computer or phone before the video becomes one connected, viewable video. Garmin and other companies have recently demonstrated interest in creating cameras that stitch......

    Continue Reading

  • Publishing your 360° content

    Publishing can be confusing for aspiring 360° video storytellers. The lack of public information on platform viewership makes it nearly impossible to know where you can best reach your intended viewers, or even how much time and effort to devote to the creation of VR content. Numbers are hard to come by, but were more available in the beginning of 2016. At the time, most viewers encountered 360° video on Facebook. In February 2016, Facebook......

    Continue Reading

  • How to Edit 360 Video in Adobe Premiere Pro CC

    Before you start editing your footage, make sure you have stitched your footage. You can read our guide to stitching here. After you have completed stitching your footage, you can now “edit” them in traditional video editing software like Adobe Premiere Pro CC. Stitching is a common term that involves merging the separate camera inputs into single viewable format. On the other hand, editing is a broad umbrella term that we will use to refer......

    Continue Reading

  • Guide to shooting 360° video

    Before embarking on any 360° video project, we strongly encourage you to ask why. It is true that a spherical video can transport and immerse viewers in a way that is hard to replicate with traditional film, but which shouldn’t be used for the sake of creating 360° video. We encourage content creators to ask themselves the following questions before deciding to shoot in 360: Are we transporting the viewer to a place they cannot......

    Continue Reading

  • An introduction to 360° video

    360° video is a fairly recent technology in which omnidirectional cameras are used to grab a spherical video capture of a space, rather than the rectangular capture in traditional videography. The perspectives of the omnidirectional cameras are then stitched together to generate an immersive experience for viewers to experience, placing the viewer within the context of a scene or event rather than presenting them as an outside observer, and giving the viewer the ability to......

    Continue Reading

Storytelling Tools

We build easy-to-use tools that can help you tell better stories.

View More