title: Positive Integer Sum, Average, Count
body: <p>I've been tasked by my programming professor to create a program that calls for a user to enter as many positive integers (including zero) as they care to enter. Anything other than a positive integer stops input and calculates/displays the Sum, Average, and Count of the numbers.</p>
  
  <p>The main issue I'm having has to do with returning multiple positive integers to be passed across the program. I can't seem to find what I need.</p>
  
  <p>inputPostiveInteger()</p>
  
  <pre><code>Pass in nothing
  Ask the user for a positive integer
  Return the integer is the user inputs one
  Return -1 if the user does not input a positive integer
  </code></pre>
  
  <p>The way he had the program shown to work would be example -</p>
  
  <pre><code>Enter a positive integer, anything else to quit: 1
  Enter a positive integer, anything else to quit: 5
  Enter a positive integer, anything else to quit: 10
  Enter a positive integer, anything else to quit: cat
  Sum 16
  Average 5.3
  Total numbers 3
  </code></pre>
  
  <p>I've tried multiple ways of try/except and while not clauses to get the input portion correct but can't seem to wrap my brain around this one.</p>
  
  <p>I understand the formulas in how to calculate / display the average, counts, sum - but can't seem to get vetted integer entries down inside of multiple formulas.</p>
  
  <p>Ex. for attemping the inputs</p>
  
  <pre><code>def inputPositiveInteger():
      try:
          userInt = int(input("Enter a positive integer, anything else to quit: ")) &gt; -1
      except ValueError:
          return -1
  
  def main():
      total = 0
      count = 0
      posInt = inputPositiveInteger()
      while posInt != -1:
          total += posInt
          count += 1
  
  main()
  </code></pre>
  
  <hr>
  
  <pre><code>total = 0
  userInt = int(input('Enter a positive integer, anything else to quit: '))
  
  while userNumber &gt; -1:
      total += userInt
      userInt = int(input('Enter a positive integer, anything else to quit: '))
  </code></pre>