Skip to content

Commit 97bab6e

Browse files
authored
Update hideen messgae
1 parent cf8f893 commit 97bab6e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

hideen messgae

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@ if __name__ == '__main__':
1616
assert find_message("How are you? Eh, ok. Low or Lower? Ohhh.") == "HELLO", "hello"
1717
assert find_message("hello world!") == "", "Nothing"
1818
assert find_message("HELLO WORLD!!!") == "HELLOWORLD", "Capitals"
19+
20+
import string
21+
def find_message(text):
22+
"""Find a secret message"""
23+
#tests
24+
if not 0 < len(text) <=1000:
25+
return ""
26+
if not all(ch in string.printable for ch in text):
27+
return ""
28+
#discover
29+
result = ''
30+
for c in text:
31+
if c.isupper():
32+
result += c
33+
return result
34+
35+

0 commit comments

Comments
 (0)