generate functionMon, 06 Mar 2023

enter a floating point number n. Output ten numbers the total sum of which is equal to n.

def f(n): if n == 0: return [] x = random.random() return [x] + f(n-x)

Want to kickstart your project?Use the new AI Studio to create your code