id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

average_length


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.


average_length(['hello']) → 5.0
average_length(['belt', 'hat', 'jelly', 'bubble_gum']) → 5.5
average_length(['thatsallfolks', 'IsayhellotoMom']) → 13.5

...Save, Compile, Run (ctrl-enter)

def average_length(lst):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy