Storage Units – Bigger or Smaller Quiz

In this challenge we are going to create a quiz using Python to test the end-user’s understanding of storage units used to describe the capacity of a storage device.

Our quiz will consist of 10 “Bigger or Smaller” questions as follows:

To complete this quiz you will need to complete the code provided below to:

    Display a welcome banner with the name of the quiz.
    Generate a random number between 1 and 999 and a random storage unit (Bytes, KB, MG, GB, TB or PB) for the first storage capacity.
    Generate a second random number between 1 and 999 and a second random storage unit for the second storage capacity.
    Display both storage capacities on the screen and ask the user if the first one is bigger or smaller than than the second one.
    Convert both storage capacities in Bytes to work out which capacity is actually bigger.
    Inform the user if their answer is correct or not.
    Repeat the whole process 10 times to create a quiz with 10 different questions.
    Include a scoring system where the suer receives a score out of 10, each correct answer giving the user and extra point.

Python Code

We have started the code below to generate the first storage capacity. Check out how the import library is used to generate a random number between 1 and 999 and to also picks a storage unit at random.

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 4

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!