Write a python program that writes data to a file. The data consists of a series...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a python program that writes data to a file. The data consists of a series of records, each with two fieids - a name, followed by a grade (assuming that the grade is non-negative, and no input validation is needed). Your program should: i. Prompt the user to enter the number of records that he/she needs to enter. ii. Write the data to the file, with each entered value on a separate line. Below is an example of what the expected output of your program should be (Do not use the same inputs): Enter the number of records that you need to enter: 3 Enter the name: Ahmad Enter the grade: 93 Enter the name: Abir Enter the grade: 95 Enter the name: Moatasem Enter the grade: 78 The created file will be: I"cores.bt-Notepad File Edit Format View Help Ahmad 93 Abir 95 Moatasem 78 100% Windows (CRLF) UTF-8 Write a python program that writes data to a file. The data consists of a series of records, each with two fieids - a name, followed by a grade (assuming that the grade is non-negative, and no input validation is needed). Your program should: i. Prompt the user to enter the number of records that he/she needs to enter. ii. Write the data to the file, with each entered value on a separate line. Below is an example of what the expected output of your program should be (Do not use the same inputs): Enter the number of records that you need to enter: 3 Enter the name: Ahmad Enter the grade: 93 Enter the name: Abir Enter the grade: 95 Enter the name: Moatasem Enter the grade: 78 The created file will be: I"cores.bt-Notepad File Edit Format View Help Ahmad 93 Abir 95 Moatasem 78 100% Windows (CRLF) UTF-8
Expert Answer:
Related Book For
Posted Date:
Students also viewed these chemical engineering questions
-
Python 3 Write a python program that generates 1,000 random integers between 0 and 9 and displays the count for each number (Hint: Use a list of ten integers, say counts, to store the counts for the...
-
Write a Python program that repeatedly reads lines from standard input until an EOFError is raised, and then outputs those lines in reverse order (a user can indicate end of input by typing ctrl-D).
-
Write a Python program that outputs all possible strings formed by using the characters 'c', 'a', 't', 'd', 'o', and g exactly once.
-
What are some advantages of sole proprietorship for PODS? What are some of the disadvantages?
-
Jonah Fitzpatrick would like to start investing and is considering purchasing some of the bonds being issued by Jennings Financial. Details of the bond issue were outlined in a recent article in...
-
(a) Prove that the Ï coefficient is equal to 1 if and only if f11 = f1+ = f+1. (b) Show that if A and B are independent, then P(A,B) Ã P(A, ) = P(A,) Ã P(, B). (c) Show that Yule's...
-
Using the notation of Exercise 4, assume that \(\sum_{i=1}^{n} 1 / r_{i}=1\), but try to find a solution where one of the \(\alpha_{k}\) 's is zero. In particular, suppose the segments are ordered in...
-
Vanishing Games Corporation (VGC) operates a massively multiplayer online game, charging players a monthly subscription of $ 15. At the start of January 2015, VGCs income statement accounts had zero...
-
The Young Corporation has the following overhead costs. Maintenance: $100,000 Supervisor Salaries: $150,000 After an ABC study, Young Corporation has the following activities and percentages....
-
Based on the latest results from Air Canada and the Royal Bank of Canada, calculate and comment on the Degree of Operating Leverage (DOL), Degree of Financial Leverage (DFL), and Degree of Combined...
-
You are working for a small company that has developed an operating system for PCs that is faster and more stable than Microsofts Windows operating system. What strategies might the company pursue to...
-
4. A runner accelerates to a velocity of 5.36 m/s due west in 3.00 s. His constant acceleration is 0.640 m/s, also directed due west. What was his velocity when he began accelerating? How far does...
-
Two concave lenses, each with f = -13 cm, are separated by 8.0 cm. An object is placed 15 cm in front of one of the lenses. a) How many cm in front of the lens closest to the object is the final...
-
A chair is pulled by two persons, one with a force of 149 N towards right and the other one pulls with a force of 82.0 N towards left. Find the unbalanced net force.
-
Shroom and Board produces mushrooms that are sold to grocery stores throughout the Southeast United States. Shroom and Board accounts for production costs using the FIFO method of process costing....
-
Palmar, Inc. provides the following selected Income Statement data for 2026: Operating Income $ 180 comma 000 Other Income and (Expenses): Loss on Sale of Capital Assets (35,000) Interest Expense (9...
-
Firefox 1 of 3 11 When reporting speech, what does the following tense change to? Past simple changes to... 01- Present perfect O2 - Past continuous 3- Past perfect O4 - Past perfect continuous 12...
-
C- Consider the following scenario:- A supermarket needs to develop the following software to encourage regular customers. For this, the customer needs to supply his/her residence address, telephone...
-
1.Suppose the MovedEventHandler delegate is defined by the statement delegate void MovedEventHandler(). Which of the following correctly declares the Moved event? a.public MovedEventHandler...
-
Consider the following relation: CAR_SALE(Car#, Date_sold, Salesperson#, Commission%, Discount_amt) Assume that a car may be sold by multiple salespeople, and hence {Car#, Salesperson#} is the...
-
In February 2008, Ceramic Crucibles of America was notified by the state of Colorado that the state was investigating the company's Durango facility to determine if there were any violations of...
-
A phenotypically abnormal individual has a phenotypically normal father with an inversion on one copy of chromosome 7 and a phenotypically normal mother without any changes in chromosome structure....
-
Explain why inversions and reciprocal translocations do not usually cause a phenotypic effect. Then explain how they can do so in certain cases.
-
A triploid plant has 18 chromosomes (i.e., 6 chromosomes per set). If we assume that a gamete has an equal probability of receiving one or two copies of each of the 6 types of chromosome, what are...
Study smarter with the SolutionInn App