大宮盆栽デイズ - Omiya Bonsai Days -

冗談めかす埼玉のファインマン

@CheckiO@Secret Message

def find_message(text: str) -> str:
    """Find a secret message"""
    import re
    s = re.findall('[A-Z]', text)
    s = ','.join(s)
    text = s.replace(',','')
    return str(text)

if __name__ == '__main__':
    print('Example:')
    print(find_message("How are you? Eh, ok. Low or Lower? Ohhh."))
    
    #These "asserts" using only for self-checking and not necessary for auto-testing
    assert find_message("How are you? Eh, ok. Low or Lower? Ohhh.") == "HELLO", "hello"
    assert find_message("hello world!") == "", "Nothing"
    assert find_message("HELLO WORLD!!!") == "HELLOWORLD", "Capitals"
    print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")