Advertisement
emily_n2

Boss_rush

Mar 28th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import re
  2.  
  3. pattern = r'^\|([A-Z]{4,})\|:#([a-zA-Z]+ [a-zA-Z]+)#$'
  4.  
  5. count = int(input())
  6. for _ in range(count):
  7.     line = input()
  8.     match = re.match(pattern,line)
  9.     if match is None:
  10.         print('Access denied!')
  11.         continue
  12.     boss_name = match[1]
  13.     title = match[2]
  14.     print(f'{boss_name}, The {title}')
  15.     print(f'>> Strength: {len(boss_name)}')
  16.     print(f'>> Armour: {len(title)}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement