Series6. An integer N and a set of N positive real numbers are given. Output in the same order the fractional parts of all numbers from a given set (as real numbers with a zero integer part), and also the product of all fractional parts.

Solution in Python 3:

import random

N = random.randrange(1,10)
print("N = ",N)
p = 1
for i in range(N):
#x = random.randrange(1,6)
x = random.uniform(0, 10)
y = x - int(x)
p *= y
print(y," : ",x," : ",p)
print()
print('Product = ', p)