def average_word_length(text):
""" (list of str) -> float
Precondition: text is non-empty. Each str in text ends with \n and at
least one str in text contains more than just \n.
Return the average length of all words in text. Surrounding punctuation
is not counted as part of the words.
>>> text = ['James Fennimore Cooper\n', 'Peter, Paul and Mary\n']
>>> average_word_length(text)
5.142857142857143
"""
""" (list of str) -> float
Precondition: text is non-empty. Each str in text ends with \n and at
least one str in text contains more than just \n.
Return the average length of all words in text. Surrounding punctuation
is not counted as part of the words.
>>> text = ['James Fennimore Cooper\n', 'Peter, Paul and Mary\n']
>>> average_word_length(text)
5.142857142857143
"""