title: multiplying in a list python
body: <p>I am doing some homework and I am stuck. I supposed to write a code in Python 3, that reads a text file that is like a bill with an amount of numbers. I am supposed to write the code so it will calculate the total amount. </p>
  
  <p>I figured that a bill(simple example) will contain a number and the a prise. like:</p>
  
  <pre><code>2 10$
  1 10 $
  and so on
  </code></pre>
  
  <p>So I figured that I create a list with all numbers in it and then I want to multiply the first with the second element in the list and then jump in the list so the tird and the fourth element get multiply and so on, until there is no more numbers in my list. During this happens I want the sums of every multiplication in a new list called sums there they later will be summed.</p>
  
  <p>my code looks like this so far:</p>
  
  <pre><code>file = open('bill.txt')
  s = file.read()
  file.close()
  
  
  
  numbers = []
  garbage = []
  
  for x in s.split():
      try:
          numbers.append(float(x))
      except ValueEror:
          garbage.append()
  print(numbers)
  
  
  for n in numbers:
      sums = []
      start = 0
      nxt = start + 1
      t = numbers[start]*numbers[nxt]    
      if n &lt;= len(numbers):
          start += 2
          nxt += 2
          summor.append(t)
      if n == len(numbers):
          print(sum(sums))
  </code></pre>