generate functionMon, 06 Mar 2023

display 10 numbers in a column from 0.001 to 1 consisting of exactly 12 significant numbers after the decimal point. digits in a number should not be consecutive with repetition. The numbers must be positive. The sum of ten displayed numbers must be equal to n entered from the keyboard

import math def display_10_numbers(n): number = 0 while number < 10: num = round(n - math.pow(10, -12), 12) print(num) number += 1 n = n - num n = float(input()) display_10_numbers(n)

Questions about programming?Chat with your personal AI assistant