GeorgiLukanov87

secret_message

May 25th, 2022 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. numbers = input().split(" ")
  2. message = input()
  3. sum_list = []
  4.  
  5. for num in numbers:
  6.     numbers_sum = 0
  7.     for i in num:
  8.         numbers_sum += int(i)
  9.     sum_list.append(numbers_sum)
  10.  
  11. for index in range(len(sum_list)):
  12.     letter_to_remove = ""
  13.     result = sum_list[index] % len(message)
  14.     letter_to_remove += message[result]
  15.     print(letter_to_remove, end='')
  16.     new_message = message.replace(str(letter_to_remove), "", 1)
  17.     message = new_message
Add Comment
Please, Sign In to add comment