title: substitute of sum function
body: <p>I am new to Python and trying to solve a task while reading the content of a text file but getting the message: ''float' object is not iterable' when trying to sum all the outputs from the variable 'sppos'.All the outputs are numbers bigger than 0 of type 0.xxxx
  Also trying to have the total of all values without using the sum function.
  Any hints which other function could be used?</p>
  
  <pre><code>fname=input('Enter a file name:')
  fhand=open(fname)
  count=0
  for line in fhand:
      line=line.rstrip()
      if not line.startswith("X-DSPAM-Confidence:") : continue
      count=count+1
      atpos=line.find(':')
      sppos=line[atpos+1:]
      sppos=float(sppos)
      print(count,sum(sppos))
  </code></pre>
  
  <p>Thanks</p>