logo CodeStepByStep logo


Language/Type: Python lists string

Write a function named average_length of code that computes and returns the average string length of the elements of a list of strings. For example, if the list contains ["belt", "hat", "jelly", "bubble gum"], the average length returned should be 5.5. Assume that the list has at least one element.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.