Print the three statistics on separate lines

Assignment Help Basic Computer Science
Reference no: EM132271655

Write the 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: EM132271655

Questions Cloud

Write the output file to that directory : Assume that the input file is in the current working directory and write the output file to that directory.
Draft corporate usage policy for use of instant messaging : You have been asked to draft a corporate usage policy regarding the use of instant messaging. The policy should encourage the use of IM and chat while also.
Health care in urban areas and for low-income public : Pretend that this Policy: Health care in Urban Areas and for Low-Income public in California, has been accepted by the committee,
Write an effective response to a common business scenario : The purpose of this paper is to demonstrate your ability to use your chosen medium to write an effective response to a common business scenario.
Print the three statistics on separate lines : Write the function named file_stats that takes one string parameter (in_file) that is the name of an existing text file. The function
Emotional intelligence or lack of emotional intelligence : How has your emotional intelligence, or lack of emotional intelligence, positively or negatively impacted your professional or personal relationships?
What is a vbscript command : What is a VBScript command I can enter into Notepad to log in and display a message?
Identify high-risk areas of a new product or process : If a risk presents an unwanted negative consequence, you may be able to completely avoid those consequences. By stepping away from the business activities.
Access your leadership capacity : Write at least three paragraphs of each question reflecting on your capacity to avoid inauthentic behaviors and pivot towards increased agility.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identify the features of the internet

Identify the features of the Internet that you need to use in your Mobile or Home Office including the following: Which browser do you prefer and why? Have you ever used a search engine other than Google

  Risk analysis on a school information assets

Let's do some risk analysis on a school's information assets. The school stores many types of about students and three of these are:

  Define a java interface for your adt

Define a Java interface for your ADT. Then implement your interface as a class and test it. Use a text file of words to populate your data structure.

  Review and discuss methods for it managers to maintain

Review and discuss methods for IT managers to maintain their skills while gaining new managerial skills

  A function defined inside a class

Which of the following term is used for a function defined inside a class? A. Member Variable B. Member function

  Short-run economic fluctuations

Identify the three key facts about short-run economic fluctuations and how the economy in the short run differs from the economy in the long run

  What is the level of required reserves

What is the level of required reserves? What is the level of excess reserves?

  Calculate the activation energy for reaction

A reaction has an initial rate of reaction of 0.001 Msec1 at 70°C. This increases to 0.010 Msec1 at 90°C. Calculate the activation energy for this reaction.

  How many sections of each of the classes are offered

What languages does the core sequence cover? Are there any introductory courses that use languages with less syntax, like Alice or Visual Logic?

  Ethical and cultural differences on a website

For this Critical Thinking assignment, you are a technical communications project manager for BCG working on the CSIC project. Read the following scenario and review the requirements for writing a proposal:

  Old website from an externally hosted solution

Tony's Chips has recently been sold to a new independent company. The new company has hired you to manage a project that will move the old Website from an externally hosted solution to an internal one. The company's leadership is very concerned about..

  Identify access controls and authentication methods

What are some of the different types of Access Control and Authentication methods that can be implemented on a Wireless Local Area Network (WLAN)?

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