Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Stressful Regex solution in Clear category for Stressful Subject by narimiran
import re
def is_stressful(subj):
return (subj.isupper() or
subj.endswith('!!!') or
any(re.search('+[.!-]*'.join(c for c in word), subj.lower())
for word in ['help', 'asap', 'urgent']))
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!')
April 27, 2017
Comments: