Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
A solution using re module. solution in Clear category for Stressful Subject by ArchTauruS
"""A solution using re module.
"""
def is_stressful(subj):
import re
red_words = ['help', 'asap', 'urgent']
red_regex = [''.join(f'{c}(\W|{c})*' for c in word) for word in red_words]
return subj.isupper() or subj.endswith('!!!') or \
any(map(lambda regex:re.search(regex, subj, re.I), red_regex))
Nov. 10, 2018
Comments: