title: Average function without sum() BUG
body: <p>I'm a beginner and currently doing the "Programming for everybody" course of the University of Michigan.</p>
  
  <p>I wrote this code myself for task 7.2 and to my understanding the code is basically done. But for some reason at line 7 of the output (you'll see when you start the program), the program starts adding 11 additional digits at the end of the sum, as if I just substracted "0.00000000000000001" from the sum.</p>
  
  <p>I just can't wrap my head around why this happens, does anybody of you see the problem?</p>
  
  <p>The text-file used for this can be found here: <a href="https://www.py4e.com/code3/mbox-short.txt" rel="nofollow noreferrer">https://www.py4e.com/code3/mbox-short.txt</a></p>
  
  <p>Thanks a lot.</p>
  
  <pre><code>file = ("mbox-short.txt")
  text = open(file)
  lcount = 0
  
  for line in text:
      line = line.rstrip()
      if not line.startswith("X-DSPAM-Confidence"):
          continue
      lcount = lcount + 1
      print()
      print("Line: ", lcount)
      #print(line)
      a = line.find(":")
      numbers = line[a+1:]
      numbers = numbers.rstrip()
      numbers = float(numbers)
      print("New Number: ", numbers)
  
      if lcount &gt; 1:
          print("Old sum: ", numbers_sum, "+", numbers)
          numbers_sum = numbers_sum + numbers
          print("New sum: ", numbers_sum)
      else:
          numbers_sum = numbers
  
  numbers_avg = numbers_sum/lcount
  print(numbers_avg)
  </code></pre>