title: How to create a simple quiz in python with multiple topics?
body: <p>I'm new to python and don't know much but think I could make quizzes pretty well and want them to be a little complicated.</p>
  
  <p>How do I make it so that the program will first have the user choose the type of test. (ie. animals or capital cities) and then the questions given to the user will be about that topic. Should I create a function with the set of question for each topic? Then when the user inputs the topic they want, the code should look something like: (roughly)</p>
  
  <pre><code>print("Do you want to answer questions on animals or capital cities or math?"
        " Type animal, city or math")
  topic = input()
  if topic == 'animal':
      def AnimalQuestions(): #this will be written before this code
  </code></pre>
  
  <p>Is this the correct approach or is there another, more efficient way to do it?</p>