Write a Python Program to Read a List of Words and Return the Length of the Longest One


Topic: Write a Python Program to Read a List of Words and Return the Length of the Longest One

Solution

a=['the', 'tsai', 'python']
max1=len(a[0])
temp=a[0]
for i in a:
    if(len(i)>max1):
       max1=len(i)
       temp=i
print("The word with the longest length is:")
print(temp)



List all Python Programs