Q. Write a program to input a line of text and print the biggest word (length wise) from it.
Answer =
sen = input("Enter the sentence :-") lst = sen.split() for i in range (len (lst)): for j in range (len(lst) -1): if len(lst[ j ]) > len(lst[j+1]): lst[ j + 1 ], lst[ j ] = lst[ j ], lst[j+1] print("Longest word =", lst[-1])
Output :
Enter the sentence :- This Path Walla Website which helps you in Computers science
Longest word = Computers
>>>
Longest word = Computers
>>>
I'm sorry, but this program is wrong.
ReplyDeleteThanks for your suggestion. Now, we have corrected the Program.
Deleteplease make a video to help
ReplyDeleteTell me the problem.
Deleteoutput
ReplyDeleteOk : )
Deletevanakam
ReplyDeletejai shree ram
ReplyDeletejai shree ram
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )