You can use the re
module. Just import it and look for digits with a .
within them. For example,
import re
def findFloat(s):
return float( re.search('[0-9]+.[0-9]+', s).group() )
This finds the first occurrence of a group of numbers separated by a .