I was inspired to create this to help me prepare for a graduate assessment exam I am taking in December for an intro to programming course. If I pass I'll get class credit - save time and money!

What it does

It takes the user input as to how many questions you would like your quiz to be. It then randomizes a list of questions I prepared about fundamental concepts in Python. Once you complete the questions, it displays your score!

How I built it

I made a dictionary of questions using a study guide I created for the GAE. The dict is then converted into a list. The list is randomized using shuffle. The program prints the total amount of questions then asks the user how many they would like to complete. A new list is made with the user input as the range for the amount of questions. That list is converted into a dictionary called shuffled_questions. The amount of correct answers and the question number is set to 0. A list called incorrect_questions is made. A for loop is used to separate the question from the multiple choice answers in the dictionary. If the answer is correct, a point is added to correct. If the answer is incorrect, the question is added to the list incorrect_questions. This iterates through all the questions in the range. At the end, the score is printed by dividing the correct value with the number of questions, then multiplying that by 100. Another for loop prints each question that was answered incorrectly and provides the correct answer for future study.

Challenges I ran into

I had a hard time randomizing the list of questions. Also implementing the feature which returns the incorrect questions gave me a hard time as well.

Accomplishments that I'm proud of

I created a quiz to study from and can access it at anytime (even via smartphone!)

What I learned

This was great practice using dictionaries in Python. I was not very comfortable before being able to access different elements in a dictionary but I feel a bit better about my abilities after completing this project!

What's next for Python Beginner Python Quiz!

More Questions! A sweet GUI! And maybe a tracker that keeps score after each attempt for further analyses.

Built With

Share this project:

Updates