Advertisement
here2share

# sum_by_increment.py

Jun 20th, 2024
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. # sum_by_increment.py
  2.  
  3. import math
  4.  
  5. def sum_by_increment(nums, add):
  6.     add = math.ceil(add / len(nums))
  7.     return [i+add for i in nums]
  8.  
  9. import random
  10.  
  11. sss = [i for i in range(10, 50)] * 2
  12. for i in '.'*20:
  13.     random.shuffle(sss)
  14.     s = [int(j) for j in sss[:4]]
  15.     t = sum(s)
  16.     ttt = str(s)
  17.     r = random.randint(1,200)
  18.     print(ttt, sum_by_increment(s, r), r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement