title: My program keeps getting an error "division by zero"
body: <p>This program is designed to count an unspecified amount of integers,
  determines how many negative and positive values have been read, 
  and computes the average and total of the input values. </p>
  
  <p>If the user inputs a 0, the program will end.  Every time I enter a 0, I get an error stating "division by zero".  The debugger says it is from the very last line.  </p>
  
  <p>I guess it has to to with the <code>sum / count</code> part.  When I use negative numbers, it says the same thing, from the same line of code. Lastly, I am unsure how to display the text "You didn't enter any number". I tried doing the if else statement, but I don't think I'm doing that correctly. </p>
  
  <pre><code>data = eval(input("Enter an integer, the input ends if it is 0: "))
  count = 0
  sum = 0
  negCount = 0
  if data != 0:             
      while data &gt; 0:     
          count = count + 1
          sum = sum + data 
          data = eval(input("Enter an integer, the input ends if it is 0: "))       
          while data &lt; 0:
              negCount = count + 1
              sum = sum + data
              data = eval(input("Enter an integer, the input ends if it is 0: "))
              while data != 0:
                  sum = sum + data              
                  data = eval(input("Enter an integer, the input ends if it is 0: "))
                  break
              else:   
                  print("You didn't enter any number")                       
  
  
  
  print("The number of positives is", count)
  print("The number of negatives is", negCount)
  print("The total is", sum)
  print("The average is", sum / count)
  </code></pre>