You've built a Mad-Libs game with some help from Sean. Now you'll work on your own game to practice your skills and demonstrate what you've learned.

For this project you'll be building a fill-in-the-blanks quiz. Your quiz will prompt a user with a sentence containing several blanks. The user should then be asked to fill in each blank appropriately to complete the sentence. This can be used as a study tool to help you remember important vocabulary!

You can find some starter code for this project along with all the other lessons in the Supporting Materials below.

In addition to the starter code file (fill-in-the-blanks.py) we've also given you a file called fill-in-the-blanks.pyc which is a working version of the project. A .pyc file is a Python file that has been translated into "byte code". This means the code will run the same as the original .py file, but if you open it in your text editor, it won't look like Python! You can run it just like a regular Python file to see how your code should behave.

PROJECT SPECIFICATION

Game Basics

Game has 3 or more levels and each level contains 4 or more blanks to fill in

Beginning the Game

Immediately after running the program, user is prompted to select a difficulty level from easy / medium / hard

Once a level is selected, game displays a fill-in-the-blank and a prompt to fill in the first blank.

Game Play

When player guesses correctly, new prompt shows with correct answer in the previous blank and a new prompt for the next blank

When player guesses incorrectly, they are prompted to try again

Code Review

Use of Variables

Code uses variables to avoid magic numbers

Each variable name reflects the purpose of the value stored in it

Once initiated, the purpose of each variable is maintained throughout the program

No variables override Python built-in values (for example, def)

Use of Functions

Functions are used as tools to automate tasks which are likely to be repeated

Functions produce the appropriate output (typically with a return statement) from the appropriate input (function parameters)

No functions are longer than 18 lines of code (does not include blank lines, comments, or function definitions)

Appropriate Use of Data

The appropriate data types are used consistently (strings for text, lists for ordered data, nested lists as appropriate)

Appropriate Use of Coding Techniques

Student demonstrates coding techniques like branching and loops appropriately (i.e. to loop through a list, for element in list:; or to test whether something is in a list, if name in list_names:)

Comments / Documentation

Each function includes a comment which explains the intended behavior, inputs, and outputs (if applicable)

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.