def soros_ellenallas(xs):
    return sum(xs)

xs = []
while True:
    x = input("")
    if not x:
        break
    xs.append(float(x))

print(soros_ellenallas(xs))
            
        

Output:

def soros_ellenallas(xs): return sum(xs) xs = [] while True: x = input("") if not x: break xs.append(float(x)) print(soros_ellenallas(xs))