def previous_real_word(words, i):
    """Returns the first word from words before position i that is non-null"""
    while i > 0:
        i -= 1
        if words[i] != "":
            break
    return words[i]