Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string_money = input().split(', ')
- beggars = int(input())
- int_money = []
- final_list = [0] * beggars
- for i in string_money:
- int_money.append(int(i))
- index = 0
- for i in range(len(int_money)):
- final_list[index] += int_money[i]
- index += 1
- if index == beggars:
- index = 0
- print(final_list)
Add Comment
Please, Sign In to add comment