def file_facts(filenm):
    """ Takes a file as input and tells you
    how many lines, words, and non whitespace
    characters are in the file """

    lines = 0
    words = 0
    chars = 0
    with open(filenm) as f:
        for line in f:
            wordlist = line.split()
            lines += 1
            words += len(wordlist)
            chars += sum(len(word) for word in wordlist)
    return (lines, words, chars)