I know this isn't the place for functions but i am desperate ...Please Help!!

Discussion created by crombaba on Mar 6, 2014
Latest reply on Mar 7, 2014 by rfairhur24
def hapax_legomena_ratio(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 hapax_legomena ratio for text. This ratio is the number of
    words that occur exactly once divided by the total number of words.

    >>> text = ['James Fennimore Cooper\n', 'Peter, Paul, and Mary\n',
    'James Gosling\n']
    >>> hapax_legomena_ratio(text)