Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Stressful Subject by Sim0000
import re
def is_stressful(subj):
for p in ('help', 'asap', 'urgent'):
if re.search('+[^A-Za-z]*'.join(p) + '+', subj.lower()): return True
return subj.isupper() 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
Comments: