Question: (ANSWER USING PYTHON 3.6) Write a function named file_stats that takes one string parameter (in_file) that is the name of an existing text file. The

(ANSWER USING PYTHON 3.6)

Write a function named file_stats that takes one string parameter (in_file) that is the name of an existing text file. The function file_stats should calculate three statistics about in_file: the number of lines it contains, the number of words and the number of characters, and print the three statistics on separate lines. For example, the following would be correct input and output. (Note: the number of characters may vary slightly between operating systems.)

>>> file_stats('created_equal.txt') lines 2 words 13 characters 72

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!