title: Compiling Python Class Objects into a List
body: <p>I'm trying to learn how to automatically compile all members of a class into a list. This segment of code is not part of a real project, but just an example to help me explain my objective. I can't seem to find any reading material on this, and I don't even know if it is possible or not. Thanks in advance for your answers! =)</p>
  
  <pre><code>class question:
      def __init__(self,question,answer,list_of_answers):
          self.question=question
          self.answer=answer
          self.list_of_answers=list_of_answers
  
  question_01=question('''
  Which of these fruits is red?
  A). Banana
  B). Orange
  C). Apple
  D). Peach
  ''',"C",("A","B","C","D"))
  
  question_02=question('''
  Which of these is both a fruit and a vegetable?
  A). Cauliflower
  B). Tomato
  C). Brocolli
  D). Okrah
  ''',"B",("A","B","C","D"))
  
  '''My objective is to write code that can automatically compile my questions (the
  members of my question class) into a list,even if I have hundreds of them, without
  having to manually write them into a list.'''
  
  #If there are only two questions, final output should automatically become:
  all_questions=[question_01,question_02]
  
  #If there are one hundred questions, final output should automatically become:
  all_questions=[question_01,question_02, ... ,question_99,question_100]
  
  #Without having to manually type all of the one hundred questions (or members
  #of the question class) to the list.
  </code></pre>