Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = list(map(int, input().split()))
- input_string = input()
- indices = []
- for number in numbers:
- number_in_list = [int(x) for x in str(number)]
- indices.append(sum(number_in_list))
- word = ""
- for index in indices:
- if index > len(input_string) - 1:
- index -= len(input_string)
- word += input_string[index]
- input_string = input_string[0:index] + input_string[index + 1:len(input_string) + 1]
- print(word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement