mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
2c29a9c40a
commit
3b66ad9dd1
@ -1,6 +1,9 @@
|
|||||||
from typing import Tuple, Optional
|
from typing import Tuple, Optional
|
||||||
|
|
||||||
def find_smallest_and_largest_words(input_string: str) -> Tuple[Optional[str], Optional[str]]:
|
|
||||||
|
def find_smallest_and_largest_words(
|
||||||
|
input_string: str,
|
||||||
|
) -> Tuple[Optional[str], Optional[str]]:
|
||||||
"""
|
"""
|
||||||
Find the smallest and largest words in a given input string based on their length.
|
Find the smallest and largest words in a given input string based on their length.
|
||||||
|
|
||||||
@ -27,8 +30,10 @@ def find_smallest_and_largest_words(input_string: str) -> Tuple[Optional[str], O
|
|||||||
|
|
||||||
return smallest_word, largest_word
|
return smallest_word, largest_word
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
|
|
||||||
input_string = input("Enter a sentence:\n").strip()
|
input_string = input("Enter a sentence:\n").strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user