One liner - as simple as possible solution in Clear category for Secret Message by Pelmen323
def find_message(message: str) -> str:
return ''.join([i for i in message if i.isupper() == True])
if __name__ == '__main__':
print(find_message(('How are you? Eh, ok. Low or Lower? '
# These "asserts" are used for self-checking and not for an auto-testing
assert find_message(('How are you? Eh, ok. Low or Lower? '
+ 'Ohhh.')) == 'HELLO'
assert find_message('hello world!') == ''
assert find_message('HELLO WORLD!!!') == 'HELLOWORLD'
print("Coding complete? Click 'Check' to earn cool rewards!")
Sept. 14, 2021