{"id":20317,"date":"2021-09-09T19:57:50","date_gmt":"2021-09-09T14:27:50","guid":{"rendered":"https:\/\/python-programs.com\/?p=20317"},"modified":"2021-11-22T18:36:23","modified_gmt":"2021-11-22T13:06:23","slug":"python-program-to-find-the-shortest-word-in-a-string","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-shortest-word-in-a-string\/","title":{"rendered":"Python Program to Find the Shortest Word in a String"},"content":{"rendered":"

In the previous article, we have discussed Program to Print First 50 Natural Numbers Using Recursion<\/a><\/p>\n

Given a string and the task is to find the shortest word in a given string.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given String = \"Hello this is BTechGeeks online Platform\"<\/pre>\n

Output:<\/strong><\/p>\n

Printing the shortest length word :\r\nis<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given String = \"good morning btechgeeks\"<\/pre>\n

Output:<\/strong><\/p>\n

Printing the shortest length word :\r\ngood<\/pre>\n

Program to Find the Shortest Word in a String in Python<\/h2>\n

Below are the ways to find the shortest word in a given string:<\/p>\n