def avg_len_sent(text):
    """Calculates the average length of sentences, in tokens"""
    token_count = len(text.split())
    sent_count = text.count(". ") + 1
    if sent_count != 0:
        return token_count / sent_count
    else:
        return 0