Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Uncategorized category for Stressful Subject by Elena_Korljukova
def is_stressful(subj):
s = list(filter(lambda x: x.isalpha(), subj.lower()))
s = s[0] + ''.join([s[i] for i in range(1,len(s)) if s[i-1] != s[i]])
return any(i in s for i in ['help', 'asap', 'urgent']) or subj.isupper() or subj[-3:] =='!!!'
if __name__ == '__main__':
print(is_stressful("I neeed HELP"))
#These "asserts" are only for self-checking and not necessarily for auto-testing
assert is_stressful("Hi") == False, "First"
assert is_stressful("I neeed HELP") == True, "Second"
print('Done! Go Check it!')
Aug. 20, 2020