Display the number of names that are stored in a file

Assignment Help Python Programming
Reference no: EM132355619

Question

1) A program that ask user for the name of the file. the program should display the contents of the file with each line preceded with a line number followed by a colon.The line numbering should start at 1.

2) Assume a file containing a series of name(as string) is named names.txt and exists on the computer's disk. Write program that displays the number of names that are stored in a file.(HINT: open a file and read every string stored in it. use variable to keep a count of number of items that are read from the file).

Reference no: EM132355619

Questions Cloud

Price has been increasing at 6 percent per year : Today, that company is valued at $53,296. How long has Randy owned the company if the price has been increasing at 6 percent per year?
Describe the semiotic visual elements in the logo design : Describe the semiotic/symbolic visual elements in the logo design. Discuss why having visual symbolic and iconic communication in a logo may be a good strategy.
Foreign exchange risk company faces : As the CFO of a multinational company, which financial securities can you use to manage the foreign exchange risk that your company faces?
Example of a situation where a building contractor : ?Give an example of a situation where a building contractor may want to use the discounted cash flow?(DCF) analysis method.
Display the number of names that are stored in a file : Assume a file containing a series of name is named names.txt and exists on the computers disk. Write program that displays the number of names that are stored
Discuss how you may be able to use images and visuals : Throughout this course, we have thoroughly examined the effects visuals have on viewers. We have analyzed the sensory and perceptual responses of viewers when.
What is the significance of the lease : a. Would you pay the asking price or is $120,000 a reasonable offer? b. What other factors should you consider in arriving at the purchase price?
Present value of the mixed stream of cash flows : a. Determine the present value of the mixed stream of cash flows, using a 5% dis-count rate.
Thinking of opening a new warehouse : Century Roofing is thinking of opening a new warehouse, and the key data are shown below. The company owns the building that would be used

Reviews

Write a Review

Python Programming Questions & Answers

  Design a brute-force algorithm for detecting the fakecoin

Design a brute-force algorithm (write a Python program) for detecting fakecoin. Design a decrease by constant and conquer algorithm for detecting the fake coin.

  Write a python program that spawns two threads

Write a Python program that spawns two threads, one which repeatedly writes the time of day as an HH:MM:SS string into a global variable 100 times per second.

  Write programs that read a sequence of integer inputs

Write programs that read a sequence of integer inputs and print The smallest and largest of the inputs. The number of even and odd inputs.

  Assume an n × n matrix a is given

Assume an n × n matrix A is given, containing only 1's and 0's, such that, in each row, all 1's come before all 0's. Give an O(n log n) algorithm to count all 1's in A.

  Website to inform about aspect of the local environment

ICT112 Assignment - write a Python program that generates a small web site to inform Sunshine Coast people about some aspect of the local environment or a local sustainability issue.

  Create a new pandas dataframe of data that will be used

Provide a count of the number of records. Create a new pandas DataFrame of data that will be used for target maketing and write it out to a headered csv file.

  Write a function called trig_ode which takes input parameter

Write a function called trig_ode which takes input parameters alpha, beta, y0 and tf .

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

  Write the definition of and test the function toupper

Write the definition of, and test the function toUpper which has a parameter letter: toUpper.The function returns the upper case of a given letter if possible.

  Compose a program that writes the coordinates of a random

Compose a program that writes the coordinates of a random point (a, b, c) on the surface of a sphere. To generate such a point, use Marsaglia's method.

  Write a program to determine the coefficients of expanded

Write a program to determine the coefficients of expanded form of (aX+bY+c)n. Every line in bold is questions to ask whoever runs the program to enter values or commands (y or n) at the console.

  Write a program that displays the values on the screen

Write a program that: Displays the values stored in each variable on the screen, using the following example format and accompanying additional string literal.

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