import random import math from random import shuffle
def get_numbers(total=100, count=10, regulate=False): top = total numbers = list() for i in range(count-1): if regulate: regulator = math.pow(top, 1/11) / 2 else: regulator = 1 rand_number = random.randint(0, int(top*regulator)) numbers.append(rand_number) top = top - rand_number numbers.append(top) shuffle(numbers) return numbers