Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Uncategorized category for Stressful Subject by LintuStorm
import re
def is_stressful(message):
"""
recoognise stressful subject
"""
if message.isupper() or message.endswith("!!!") or any(
re.search('+[.!-]*'.join(word), message.lower()) for word in ['help', 'asap', 'urgent']):
return True
return False
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 18, 2018