Answer to Question #231122 in Python for Rachna Pal

Question #231122

Function to count number of lines from a text files


1
Expert's answer
2021-09-02T02:03:25-0400
def count_lines(filename):
    with open(filename, 'r') as f:
        return len(f.readlines())

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS