mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Added doctest to detecting_english_programmatically.py (#11135)
This commit is contained in:
parent
eb989c08cd
commit
fa508d7b8b
|
@ -25,6 +25,18 @@ def get_english_count(message: str) -> float:
|
||||||
|
|
||||||
|
|
||||||
def remove_non_letters(message: str) -> str:
|
def remove_non_letters(message: str) -> str:
|
||||||
|
"""
|
||||||
|
>>> remove_non_letters("Hi! how are you?")
|
||||||
|
'Hi how are you'
|
||||||
|
>>> remove_non_letters("P^y%t)h@o*n")
|
||||||
|
'Python'
|
||||||
|
>>> remove_non_letters("1+1=2")
|
||||||
|
''
|
||||||
|
>>> remove_non_letters("www.google.com/")
|
||||||
|
'wwwgooglecom'
|
||||||
|
>>> remove_non_letters("")
|
||||||
|
''
|
||||||
|
"""
|
||||||
return "".join(symbol for symbol in message if symbol in LETTERS_AND_SPACE)
|
return "".join(symbol for symbol in message if symbol in LETTERS_AND_SPACE)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user