Advertisement
bl00dt3ars

03. Messaging

May 29th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. sequence = input().split()
  2. text = [el for el in input()]
  3. message = ""
  4.  
  5. for el in sequence:
  6.     current_index = 0
  7.     for index in el:
  8.         current_index += int(index)
  9.     if current_index >= len(text):
  10.         while current_index >= len(text):
  11.             current_index -= len(text)
  12.         else:
  13.             message += text[current_index]
  14.             text.pop(current_index)
  15.     else:
  16.         message += text[current_index]
  17.         text.pop(current_index)
  18.  
  19. print(message)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement