def shortest_word_length(text: str) -> int:
"""
Return the length of the shortest word in the string.
Words are separated by whitespace.
Returns 0 if no words exist.
"""
words = text.split()
if not words:
return 0
return min(len(word) for word in words)
def main():
text = "Find the shortest word length in this string"
result = shortest_word_length(text)
if result == 0:
print("No words found.")
else:
print("Length of the shortest word:", result)
if __name__ == "__main__":
main()
'''
run:
Length of the shortest word: 2
'''