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

Solution in Python 3:

import random

N = random.randrange(1,10)
print("N = ",N)
s = 0
for i in range(N):
#x = random.randrange(1,6)
x = random.uniform(0, 10)
y = int(x)
s += y
print(y," : ",s," : ",x)
print()
print('Sum = ', s)