Computer Science, asked by piyushsrivastava78, 16 hours ago

Write a Python Program to find the 2nd smallest word in an accepted string. Remember not to use def and use very less functions. Plz remember 2nd smallest word is required and not the smallest word. Plz help with this question.

Answers

Answered by samarthkrv
1

Answer:

s = input("Enter a string:")

words = list(s.split(" "))

words.sort(key=len)

print("The second smallest word is" , words[1])

Explanation:

Similar questions