generate functionMon, 06 Mar 2023

enter a floating point number n. Output ten numbers whose sum is equal to n. In the ten numbers displayed, the numbers do not go in a row. The range of output numbers is from 0.001 to 1. The output ten digits have exactly twelve digits after the decimal point. The output numbers are strictly greater than 0.

n = input() result = 0 for i in range(10): num = round(random.random(), 12) result += num print(num) print(result)

Questions about programming?Chat with your personal AI assistant