Home › Quizzes › Quiz Makers & AI Tools › Python quiz maker: code it or generate it

Make a quiz maker in Python, or get AI quizzes from your notes

Writing a small quiz program teaches lists, loops and conditionals. When you would rather study than code the question bank, DeckOwl builds multiple-choice, true/false and short-answer questions with explanations from your PDFs, slides or notes.

Create quizzes nowFree · No credit card required

Free · First set needs no signup · Creates quizzes in seconds

Building the quiz logic step by step

If you want to learn how to make a quiz maker in python, start with three pieces: a list of questions, a loop that asks each one with input(), and a score counter that goes up for each correct answer. Each question can be stored as a dictionary holding the prompt, the options and the correct answer, so the loop reads one record at a time.

  • Store each question as a dictionary with its options and answer together.
  • Use input() and convert the result with int() or float() before doing math.
  • Compare answers after calling .strip() and .lower() so small typos in case do not count as wrong.
  • Load questions from a file with open() in a with block, using json.load() or csv.DictReader.
Example Python quiz questions with answers
What does input() always return in Python 3?A string, so convert it with int() or float() before doing arithmetic. Forgetting this is a common bug in quiz scripts.
How can you compare a user's answer without caring about capital letters?Call .lower() or .casefold() on both strings before comparing. This keeps "Paris" and "paris" from counting as different answers.
What does random.choice(my_list) return?One randomly picked element from a non-empty sequence. To reorder the whole list, use random.shuffle(my_list) instead.
Why store each quiz question as a dictionary?A dictionary keeps the prompt, options and answer together under named keys, so the loop can read every field of one question at a time.
What is the safest way to read a JSON question file?Open it in a with block and call json.load(), because the file closes automatically even if an error occurs while reading.
Generate the full set

Upload your own material

Add PDFs, DOCX files, PPTX slides, plain text notes or photos of pages. Text in images is read with text recognition.

Three question types

Get multiple-choice, true/false and short-answer questions, each with an explanation of why the answer is correct.

Export when you need it

Export quizzes to PDF or DOCX on Plus. QTI 2.1 and Moodle XML export are available on Pro.

How it works

Upload notes or slides

Drop in the file you are studying from. There is no need to type out questions by hand.

Pick the question types

Choose multiple-choice, true/false or short answer, and read the explanations as you review.

Study or export

Practice in the browser on the free plan, or export to PDF, DOCX, Anki or CSV on Plus.

Once the basic loop works, add the parts that make it feel like a real quiz. Normalize answers with .lower() or .casefold() before comparing them, shuffle the order with random.shuffle(), and load questions from a JSON or CSV file so you can edit them without touching the code. Print the final score at the end.

The coding exercise is useful for learning Python, but writing a new question bank for every topic takes longer than studying it. DeckOwl works from your own material instead, so you can compare a hand-built Python quiz with questions generated from your lecture notes and choose the approach that fits your course.

Explore related topics

Frequently asked questions

What Python concepts does a basic quiz program need?

You need a list or dictionary of questions, a loop to ask each one, input() to read answers, and an if statement to compare them. A counter variable tracks the score.

How do I check answers without worrying about capital letters?

Convert both the stored answer and the user's input with .lower() or .casefold() before comparing them. Calling .strip() first also removes extra spaces.

Is there a free DeckOwl plan?

Yes. The free plan includes 3 generations per month and studying in the browser. Exports are part of paid plans.

Can DeckOwl export quizzes to Moodle XML?

Moodle XML and QTI 2.1 export are included on the Pro plan at $14.99 per month. Plus at $39 per year or $7.99 per month covers PDF, DOCX, Anki and CSV export.

Generate free quizzes

Keep exploring the topic

Review the main ideas visually or practice recalling them.