floats = map(float, s.split()) #above will return map, for python3 to return list do #floats = list(map(float, s.split()))