Pergunta de entrevista da empresa Ladders

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