title: Finding all numbers in a text and returning them in a list of floats in python
body: <p>I have extracts of text, and need to create a function that finds all numbers in the text and returns them in a list of floats.</p>
  <p>It would be great if commas could be used to separate thousands and several consecutive numbers could be separated by a comma and space</p>
  <pre><code>E.g., extract_numbers(&quot;12 days of XMas&quot;) is [12.0]
  E.g., extract_numbers(&quot;1, 2, 3, un pasito pa'lante Maria&quot;)
  is [1.0, 2.0, 3.0]
  
  :param text: string that forms English text
  :return: list of numbers (as floats) that are present in the text
  :rtype: list
  </code></pre>
  <pre><code>  #Variable for storing the sum 
  a = 0
    
   #Iterating through the content 
   #Of the file 
  for line in content: 
        for i in line: 
            
          # Checking for the digit in  
          # the string 
          if i.isdigit() == True: 
                
              a += int(i) 
    
  [float(i) for i in a]
  print(&quot;The sum is:&quot;, a)
  </code></pre>
  <p>Unfortunately I am receiving a TypeError :</p>
  <p><code>'int' object is not iterable' at '[float(i) for i in a]' </code></p>