Longest word Get link Facebook X Pinterest Email Other Apps Longest wordQUESTION DESCRIPTIONPython Program to Read a List of Words and Return the Length of the Longest OneInput:First Line has the Number of Words the followed by the wordsOutput:Print the longest word in the list.n=int(input())l=[] leng=0for i in range (0,n): v1=input() l.append(v1)for i in range(0,n): l1=len(l[i]) if l1>leng: leng=l1for i in range(0,n): if leng==len(l[i]): print(l[i]) Comments
Comments
Post a Comment