Sums of tens

from random import randint items = 60 group_size = 10 nums = [randint(0,99) for i in range(items)] print(nums) ''' [ 95, 98, 83, 82, 28, 66, 68, 29, 97, 36, 88, 65, 2, 90, 44, 55, 59, 78, 26, 30, 76, 86, 68, 63, 96, 3, 1, 74, 2, 72, 10, 60, 8, 94, 0, 45, 78, 88, 55, 88, 14, 97, 68, 16, 2, 33, 76, 80, 23, 43, 56, 6, 54, 46, 16, 35, 61, 96, 36, 41 ] ''' print([sum(nums[i*group_size : (i+1)*group_size]) for i in range(items/group_size)]) # [682, 537, 541, 526, 452, 447]