title: Application prints duplicate element Python
body: <p>I want the write an application that can print out all the questions from a list. But not sure what is wrong with my code, the list does not print out in incremental order. Instead it goes from 0,0,1,0,1,2. I don't understand why it has to reprint the previous element. I expect the list to print out like 0,1,2,3 ... I know there is another alternative to get the result I want, but I want to understand what I did wrong. I am a newbie, any help is appreciated!</p>
  <p>question_model.py</p>
  <pre><code>class Question:
      def __init__(self, text, answer):
          self.text = text
          self.answer = answer
  </code></pre>
  <p>quiz_brain.py</p>
  <pre><code>class QuizBrain:
      def __init__(self,questions_list):
          self.question_number = 0
          self.questions_list = questions_list
          self.number_of_question = len(questions_list)
  
  
  
      def next_question(self):
          current_question = self.questions_list[self.question_number]
          input(f&quot;{self.question_number}:{current_question.text} (True/False): &quot;)
          self.question_number += 1
  
  
      def still_has_questions(self):
          while self.question_number &lt; self.number_of_question-1:
              self.next_question()
  </code></pre>
  <p>data.py</p>
  <pre><code>question_data = [
      {&quot;text&quot;: &quot;A slug's blood is green.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;The loudest animal is the African Elephant.&quot;, &quot;answer&quot;: &quot;False&quot;},
      {&quot;text&quot;: &quot;Approximately one quarter of human bones are in the feet.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;The total surface area of a human lungs is the size of a football pitch.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;In West Virginia, USA, if you accidentally hit an animal with your car, you are free to take it home to eat.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;In London, UK, if you happen to die in the House of Parliament, you are entitled to a state funeral.&quot;, &quot;answer&quot;: &quot;False&quot;},
      {&quot;text&quot;: &quot;It is illegal to pee in the Ocean in Portugal.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;You can lead a cow down stairs but not up stairs.&quot;, &quot;answer&quot;: &quot;False&quot;},
      {&quot;text&quot;: &quot;Google was originally called 'Backrub'.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;Buzz Aldrin's mother's maiden name was 'Moon'.&quot;, &quot;answer&quot;: &quot;True&quot;},
      {&quot;text&quot;: &quot;No piece of square dry paper can be folded in half more than 7 times.&quot;, &quot;answer&quot;: &quot;False&quot;},
      {&quot;text&quot;: &quot;A few ounces of chocolate can to kill a small dog.&quot;, &quot;answer&quot;: &quot;True&quot;}
  ]
  </code></pre>
  <p>main.py</p>
  <pre><code>from question_model import Question
  from data import question_data
  from quiz_brain import QuizBrain
  
  
  
  
  question_bank = []
  
  for i in question_data:
      question_text = i[&quot;text&quot;]
      question_answer = i[&quot;text&quot;]
      new_question = Question(question_text,question_answer)
      question_bank.append(new_question)
  
      quiz = QuizBrain(question_bank) #create the new quiz object
      quiz.still_has_questions()
  </code></pre>