Series4. An integer N and a set of N real numbers are given. Output the sum and product of numbers from the given set.

Solution in Python 3:

import random

N = 5
s = 0
p = 1
for i in range(N):
x = random.randrange(1,6)
#x = random.uniform(1, 10)
print(x, end="; ")
s += x
p *= x
print()
print('Sum = ', s)
print('Product = ', p)