Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Stressful Subject by vnkvstnk
import itertools
def is_stressful(subj):
alpha_subject = "".join([x for x in subj if x.isalpha()])
unique_subject = "".join([x[0] for x in itertools.groupby(alpha_subject)])
red = ("help", "asap", "urgent")
cond_1 = subj.endswith("!!!")
cond_2 = alpha_subject.isupper()
cond_3 = any([x in unique_subject.lower() for x in red])
return cond_1 or cond_2 or cond_3
June 14, 2019