Calculate three statistics about in_file

Assignment Help Computer Engineering
Reference no: EM133499490

Question: 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:

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

Note: The number of characters may vary slightly between operating systems. Similarly, the number of lines may vary by 1 line, depending on the method used to calculate it.

Reference no: EM133499490

Questions Cloud

Preservation and sustainable administration : preservation and sustainable administration of the temperate deciduous forest biome, it is crucial to comprehend and manage these factors
What actions can be taken to reduce vulnerability for this : What is a priority health problem/issue in impacting this group? Brief description of health issue Significance of this problem or issue
To what extent do you believe individualism influences : To what extent do you believe individualism influences the mindset of educators? Is it possible for teachers to be successful without embracing collaboration?
What are the benefits : What are the benefits and Give a scenario in which this resource would be used by a security professional
Calculate three statistics about in_file : 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
Why do you believe change is so pervasive in education : TLC 803- Why do you believe change is so pervasive in education? Explain. Based on current educational research, what do you think the next change will be?
How did medieval islamic civilization become world leader : How did the medieval Islamic civilization become a world leader in science in its time? How did it integrate science into its institutions
Identify workstation domain-known vulnerabilities : Identify Workstation Domain-known vulnerabilities and exploits on the Common Vulnerabilities & Exposures (CVE) database listing of common vulnerabilities
Are you comfortable with giving away some of your privacy : Are you comfortable with giving away some of your privacy for increased security? Why or why not? How far would you let the government examine peoples private

Reviews

Write a Review

Computer Engineering Questions & Answers

  Evaluate the role that computer technology has

Discuss how you believe computer technology has changed your field of study of Psychology and future profession as a Psychologist. Evaluate the role that.

  Discuss what performance management is

Discuss what performance management is and how it influences effective teams. Review table 11.1, define leadership behaviors (in your own words) and note which.

  Create an outline in the scope of your risk management plan

For each of the domains, create an outline in the scope of your risk management plan. Include the following topics- the five major parts of an IT risk.

  Write a case statement that given an integer selector

Write a case statement that, given an Integer selector called Name, will print your first name if Name = 1, your middle initial if Name = 2, your last name.

  Information technology in public health

Information Technology in Public Health

  List all students and courses they are registered for

List all students and courses they are registered for. Include, in this order, CustomerNumber, CustomerName, Phone, CourseNumber, and AmountPaid.

  How long will ram take to read given values in page mode

A 4 M x 1 dynamic RAM, organized as a 2,048 x 2,048 cell array, has a to of 70 ns. How long will it take to read 1,024 values in page mode?

  Who do you think should be responsible for security

Who do you think should be responsible for security in your company? Refer to the readings in your answer and explain the position you have taken

  Write a program that prompts the user to input an integer

Write a program that prompts the user to input an integer that represents cents.

  Write an inheritance hierarchy for classes quadrilateral

Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class of the hierarchy.

  Describe and list factors used in mi calculations

Describe and list factors used in MI calculations and Based on engineers' experience, how effective and accurate MI is in quantifying maintainability

  Find the total cost of the first hundred units

A company's marginal cost function is MC(x)(given below), where x is the number of units. Find the total cost of the first hundred units (x = 0to x = 100).(Round your answer to the nearest cent.) MC(x) = 4e-0.02x

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd