2. Write a short Python code segment that adds up the lengths of all the words in a list and then prints the average (mean) length. Use the final list from previous question to test your program.

# Code

l = [‘No’, ‘country’, ‘has’, ‘ever’, ‘won’, ‘a’, ‘war’]
c = 0

for word in l:
c += len(word)

print(‘Mean length of the words in the list is :’, c/len(l))
# len(l) gives number of words in the list