Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key_list = list(map(int, input().split()))
- while True:
- text = input()
- if text == "find":
- break
- new_text = ''
- for index in range(len(text)):
- index_key = index
- if index_key >= len(key_list):
- index_key %= len(key_list)
- letter = chr(ord(text[index])-key_list[index_key])
- new_text += letter
- start_type_index = new_text.index("&")
- end_type_index = start_type_index + 1 + new_text[start_type_index+1:].index("&")
- type_treasure = new_text[start_type_index+1:end_type_index]
- start_coordinate_index = new_text.index("<")
- end_coordinate_index = new_text.index(">")
- coordinates = new_text[start_coordinate_index + 1:end_coordinate_index]
- print(f"Found {type_treasure} at {coordinates}")
Advertisement
Add Comment
Please, Sign In to add comment