title: How to print every input value which come from a while loop
body: <p>I want to know how to print every value I got from a while loop. I want this code can print every account, first num, and second num out.</p>
  
  <p>Example:</p>
  
  <pre><code>input account: 5555
  
  input first num: 2323
  
  input second num: 4343
  
  print: "Thank you. Next"
  
  (Continue)
  
  input account: 6666
  
  input first num: 1313
  
  input second num: 5353
  
  print: "Thank you. Next"
  
  (Continue)
  
  input account: -1
  
  print: "Finished Entering Account"
  
  (Break)
  
  
  
  
  
  output:
  
  5555  2323  4343
  
  6666  1313  5353
  </code></pre>
  
  <p>Code:</p>
  
  <pre class="lang-py prettyprint-override"><code>def getaccount(prompt):
      while(True):
          try:
              num = int(input(prompt))
              if num &gt;= -1 and num &lt;= 99999:
                  return num
              else:
                  print("Outside range, try again.")
          except ValueError:
              print("Unacceptable entry. Try again.")
  
  
  def getfirstnum(prompt):
      while(True):
          try:
              num = int(input(prompt))
              if num &gt;= 0 and num &lt;= 9999:
                  return num
              else:
                  print("Outside range, try again.")
          except ValueError:
              print("Unacceptable entry. Try again.")  
  
  
  def getsecondnum(prompt):
      while(True):
          try:
              num = int(input(prompt))
              if num &gt;= 0 and num &lt;= 9999:
                  return num
              else:
                  print("Outside range, try again.")
          except ValueError:
              print("Unacceptable entry. Try again.")
  
  
  # Main
  while (True):
      num1 = getaccount("Enter a 5 digit account number (#####) or enter -1 to end:")
      if num1 == -1:
          print("Finished Entering Account.")
          break
      num2 = getfirstnum("Enter the first gas reading (####): ")
      num3 = getsecondnum("Enter the second gas reading (####): ")
      print("Thank you. Next.")
  
  </code></pre>