Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string_of_integers = input().split(', ')
- count_of_beggars = int(input())
- sum_of_integers = 0
- more_sum_of_integers = 0
- output = []
- if count_of_beggars < len(string_of_integers):
- output = [0] * count_of_beggars
- index = 0
- for i in range(len(string_of_integers)):
- if index == count_of_beggars:
- index = 0
- output[index] += int(string_of_integers[i])
- index += 1
- elif count_of_beggars == len(string_of_integers):
- for x in string_of_integers:
- output.append(int(x))
- elif count_of_beggars > len(string_of_integers):
- for x in string_of_integers:
- output.append(int(x))
- for x in range(count_of_beggars - len(string_of_integers)):
- output.append(0)
- print(output)
Advertisement
Add Comment
Please, Sign In to add comment