Ledger Nano X - The secure hardware wallet
SHARE
TWEET

boss_rush

a guest Mar 28th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import re
  2.  
  3.  
  4. def find_name(string):
  5.     boss_regex = r"\|[A-Z]+\|"
  6.     match = re.findall(boss_regex, string)
  7.     result = "".join(match).strip('|')
  8.     if len(result) >= 4:
  9.         return result
  10.     else:
  11.         return None
  12.  
  13.  
  14. def find_title(string):
  15.     title_regex = r"(?<=\|\:\#)[A-Za-z]+[ ][A-Za-z]+(?=#)"
  16.     title = re.findall(title_regex, string)
  17.     if len(title) > 0:
  18.         return "".join(title)
  19.     else:
  20.         return None
  21.  
  22.  
  23. def return_results(string):
  24.     name = find_name(string)
  25.     title = find_title(string)
  26.     if name is not None and title is not None:
  27.         return f"{name}, The {title}\n>> Strength: {len(name)}\n>> Armour: {len(title)}"
  28.     else:
  29.         return "Access denied!"
  30.  
  31.  
  32. lines_of_input = int(input())
  33.  
  34. for i in range(lines_of_input):
  35.     user_input = input()
  36.     print(return_results(user_input))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top