I want to write a function that would return the length of the shortest string in a string of words. Sample: \"I eat apples\" would return 1 since \"I\" is the shorted string. T
A function to estabilish the lenght of the smallest word in a text
def lenmin(text): return len(min(text.split())) lenmin("I eat apples")
This will return 1
Using lambda
>>> lenmin = lambda t: len(min(t.split())) >>> lenmin("you eat apples") 2