Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Stressful Subject by harrior
def is_stressful(subj):
if subj[-3:] == '!!!' or subj.isupper():
return True
clean_subj = ''.join([c for i, c in enumerate(subj) if c.isalpha() and subj[i-1] != c]).lower()
return any([True for i in ("help", "asap", "urgent") if i in clean_subj])
if __name__ == '__main__':
#These "asserts" are only for self-checking and not necessarily for auto-testing
assert is_stressful("Hi") == False, "First"
assert is_stressful("I neeed HELP") == True, "Second"
print('Done! Go Check it!')
Feb. 20, 2020