#Length of longest word in a String
import string
s=raw_input("Enter the String:")
a=string.split(s)
l_word=a[0]
l_length=a[0]
for i in range(0,len(a)):
if len(a[i])>len(l_word):
l_length=len(a[i])
l_word=a[i]
print "The longest word is ",l_word," with length:",l_length
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment