Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Any isalpha solution in Clear category for Stressful Subject by Striga
def is_stressful(subj):
words = ['help', 'asap', 'urgent']
tick = subj.lower()[0]
for i in subj.lower():
if i.isalpha() and i != tick[-1]: tick += i
if subj.isupper() or subj[-3:] == "!!!" or any(i in tick for i in words):
return True
return False
if __name__ == '__main__':
assert is_stressful("Hi") == False, "First"
assert is_stressful("I neeed HELP") == True, "Second"
Oct. 28, 2020