How to find the average string length in a list of strings with Python

1 Answer

0 votes
lst = ['python', 'php', 'java', "c#"] 

lenn = sum(map(len, lst))/float(len(lst)) 

print(lenn)



'''
run:

3.75

'''

 



answered Jan 21, 2020 by avibootz
...