Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago