generate functionTue, 07 Mar 2023

The fractional number n is entered from the keyboard. Print ten numbers whose sum is equal to n.

def fractional_part(n): s = 0 for i in range(1, 10): while (s < n): s += 1 / i print(s) return None fractional_part(0.5)

Questions about programming?Chat with your personal AI assistant