Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Creative category for Stressful Subject by Sim0000
import re
def is_stressful(subj):
pat = '|'.join('(' + '+[^A-Za-z]*'.join(p) + ')' for p in ('help', 'asap', 'urgent'))
return subj.isupper() or re.search(pat, subj.lower()) is not None or subj.endswith('!!!')
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert is_stressful("Hi") == False, "First"
assert is_stressful("I neeed HELP") == True, "Second"
print('Done! Go Check it!')
July 2, 2017