title: ValueError: could not convert string to float: '30,'
body: <p>its my 1st post in Stack overflow.</p>
  
  <p>I am getting error when im doing an exercise for college and i would love to get some help since im new to python but i have some programming knowledge ( with c#) so i find it extremely difficult to code with this new language. </p>
  
  <p>i have this array as an example: 30, 20, 10, 15, 20, 34, 23, 12, 23, 34, 30, 15, 51 
  those are the numbers i need for the output to be: ~[7.4] <br> but each time i insert it it gives the code error: ValueError: could not convert string to float: '30,'.</p>
  
  <p>dont have anything with errors(i think) so i dont know how to solve this.</p>
  
  <p>I appreciate your help in advance.</p>
  
  <pre><code>import sys 
  
  
  def floats_println_bracket(a):
  print("[", end='')
  if (len(a) &gt; 0):
      print("%g" % a[0], end='')
      for i in range(1, len(a) ):
          print(" %g" % a[i], end='')
  print("]")
  
  
  def rewards(a):
  global trimmedvalue 
  temp = []
  for i in len(a):
      if i//3 == 0:
         comission = temp.append(i) 
         total = a[i - 1] + a[i - 2] + [i - 3]        
      if total &gt; 60:        
          comissionvalue = trimmedvalue
          comissionvalue = trimmedvalue + (total * 0.05)
          comission.append(comissionvalue)            
      return comission
  
  
  
  def test_rewards():
  while True:
      a = []
      try:
          line = input().split()
      except (EOFError, KeyboardInterrupt):
              sys.exit(0)
      if line:
          for i in line:
              a.append(float(i))
      z = rewards(a)
      floats_println_bracket(z)
  
  if __name__ == '__main__':
  test_rewards()
  </code></pre>