Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sum_by_increment.py
- import math
- def sum_by_increment(nums, add):
- add = math.ceil(add / len(nums))
- return [i+add for i in nums]
- import random
- sss = [i for i in range(10, 50)] * 2
- for i in '.'*20:
- random.shuffle(sss)
- s = [int(j) for j in sss[:4]]
- t = sum(s)
- ttt = str(s)
- r = random.randint(1,200)
- print(ttt, sum_by_increment(s, r), r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement