Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
stressful-subject.py solution in Clear category for Stressful Subject by s_m
def is_stressful(subj):
"""
recoognise stressful subject
"""
import re
subj = re.sub(r'\b[!.-]\b', '', subj)
return subj.isupper() or any(re.findall(r'u+r+g+e+n+t+|h+e+l+p+|a+s+a+p+|!!!$', subj.lower()))
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!')
March 13, 2018
Comments: