title: How can I use a value that is already inside a function in another function?
body: <p>I am working on a program to build a quiz. 
  I need to get my "true" out of the first loop in order to use it for the second.</p>
  
  <p>As it is right now, Python says that <code>"true" is not defined</code>.</p>
  
  <pre><code>def verif(): #this is the function to check if answer was right
      y=(chosen_answer.get())
      true=0
      if chosen_answer==1:
         true=true+1
      else:
          true=true  #at the end true represents the number of correct answers
      return true 
  def final_count():
      if true==2:   #here it shows that "true" was not identified
          print("All of the answers were answered correctly!")
      elif true==1:
          print("50% were answered correctly")
      else:
          print("none of the answers were right..")
  </code></pre>