I\'m either looking for an algorithm or a suggestion to improve my code to generate a list of random numbers that their sum equals some arbitrary number. With my code below
You could keep a running total rather than having to call sum(my_sum) repeatedly.
sum(my_sum)