def tf(term, document):
    """
    computes term frequency. TF is defined as how often the term in question
    appears in a document over the sum of all terms in the document:
    (term/all_terms_in_doc).

    Parameters:
        term: a string containing the search term
        document: a list representing the document text, split into tokens
            (make sure that punctuation is split, too!)

    Return Value: a float representing the tf value
    """
    terms_found = 0
    for token in document:
        if token == term:
            terms_found += 1
    return terms_found/len(document)