list1 = []
list2 = []
b = int(input('enter no of words'))
for i in range(b):
c = input('enter word : ')
list1.append(c)
list2.append(len(c))
c = list2.index(max(list2))
print('longest word is ',list1[c],' length is ',list2[c])
list2 = []
b = int(input('enter no of words'))
for i in range(b):
c = input('enter word : ')
list1.append(c)
list2.append(len(c))
c = list2.index(max(list2))
print('longest word is ',list1[c],' length is ',list2[c])
No comments:
Post a Comment