Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- text = input()
- pattern = r'\=[A-Z][A-z]{2,}\=|\/[A-Z][A-z]{2,}\/'
- matches = re.findall(pattern, text)
- power = 0
- result = []
- places = ""
- for place in matches:
- places += place
- pattern_two = r'[A-z]+'
- result = re.findall(pattern_two, places)
- for dest in result:
- power += len(dest)
- print(f'Destinations: {", ".join(result)}')
- print(f"Travel Points: {power}")
Advertisement
Add Comment
Please, Sign In to add comment