def reading (file): nums = [] with open(file) as file: for line in file: nums.extend(map(float, line.split())) return nums