Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- regex = r"^[|](?P<name>[A-Z]{4,})[|][:][#](?P<title>[A-Z]{1}[a-z]+[ ][a-z]+)[#]$"
- for n in range(int(input())):
- text = input()
- matches = re.match(regex, text)
- if matches:
- name = matches.group("name")
- title = (matches.group("title")).split()
- title_print = " ".join(title)
- print(f"{name}, The {title_print}")
- print(f">> Strength: {len(name)}")
- print(f">> Armour: {len(title_print)}")
- else:
- print("Access denied!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement