title: ValueError: could not convert string to float — user input with Python
body: <p>I'm trying to write a 'while' loop that takes a users input, if it is a number it remembers it, if it is a blank space it breaks. At the end it should print the average of all entered numbers. This is giving me the error 'could not convert string to float: '. What exactly is wrong here? Thanks!</p>
  
  <p>EDIT: I re-wrote it like this and I get the same error about converting, but it seems to be on the final (count += 1) line?</p>
  
  <pre><code>number = 0.0
  count = 0
  
  while True:
      user_number = input('Enter a number: ')
      if user_number == ' ':
          break
          print (number / count)
      number = number + float(user_number)
      count += 1
  </code></pre>