Skip to content

Commit 07135d6

Browse files
Suyashd999cclauss
authored andcommitted
Added doctest to detecting_english_programmatically.py (TheAlgorithms#11135)
1 parent 192edbf commit 07135d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

strings/detecting_english_programmatically.py

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ def get_english_count(message: str) -> float:
2525

2626

2727
def remove_non_letters(message: str) -> str:
28+
"""
29+
>>> remove_non_letters("Hi! how are you?")
30+
'Hi how are you'
31+
>>> remove_non_letters("P^y%t)h@o*n")
32+
'Python'
33+
>>> remove_non_letters("1+1=2")
34+
''
35+
>>> remove_non_letters("www.google.com/")
36+
'wwwgooglecom'
37+
>>> remove_non_letters("")
38+
''
39+
"""
2840
return "".join(symbol for symbol in message if symbol in LETTERS_AND_SPACE)
2941

3042

0 commit comments

Comments
 (0)