In this program, we will take a string as input and find the longest and smallest word in the input string
Steps to solve the program
- Take a string as input.
- Convert the list into a list using split().
- From that list find the longest and smallest word using max() and min().
- Use the key as len to find them in the min and max functions.
- Print the output.
Output : When we will run above program we will get following output.