Domanda di colloquio di Ladders

Write a function that, given a string of words, returns the average word length.