Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- valid = []
- delimiter = []
- text = input()
- pattern = r"(::|\*\*)([A-Z][a-z]{2,})\1"
- s = re.findall(pattern,text)
- for i in s:
- valid.append(i)
- coolness= [int(i) for i in text if i.isdigit()]
- coolness_result = 1
- for x in coolness:
- coolness_result = coolness_result * x
- int_valid=[]
- for string in valid:
- if (sum([ord(i) for i in string[1]]))>=coolness_result:
- int_valid.append(string)
- print (f"Cool threshold: {coolness_result}")
- print (f"{len(valid)} emojis found in the text. The cool ones are:")
- for i in int_valid:
- print (f"{i[0]}{i[1]}{i[0]}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement