Example-
string is "This is the string"
here smallest word is "is"
program-
import functools
print("Enter string")
s=input()
l=s.split()
def func(x,y):
if len(x)<'len(y):
return x
else:
return y
x=functools.reduce(func,l)
print("Smallest Word is :",x)
Enter string
This is string
Smallest Word is : is