A file named datal.txt contains an unknown number of lines, each consisting of a single integer....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A file named datal.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates a file named data2.txt and copies all the lines of datal.txt to data2.txt. 1 infile = open ('datal.txt', 'r') 2 plus = open ('data2.txt', 'w') for line in infile: 3- 4 plus.write (line) 5 infile.close()) 6 plus.close() A file named datal.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates a file named data2.txt and copies all the lines of datal.txt to data2.txt. 1 infile = open ('datal.txt', 'r') 2 plus = open ('data2.txt', 'w') for line in infile: 3- 4 plus.write (line) 5 infile.close()) 6 plus.close()
Expert Answer:
Answer rating: 100% (QA)
Code to copy all the lines from data1txt to data2txt Open the in... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
31. A cyclist has just finished a race. At the finish line they were travelling at 14m/s, and began to subject themselves to an acceleration of -1.8m/s/s a) what is the cyclist's velocity 4 seconds...
-
A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that reads through the file, ignoring those value that are not bigger than...
-
Suppose a space vehicle with a rest mass of 150000 kg travels past the International Space Station at a constant speed of 2.6 x 108 m/s with respect to the I.S.S. When an observer on the I.S.S....
-
Air flows through the fine mesh gauze shown in the figure below with an average velocity of 1.50 m/s in the pipe. Determine the loss coefficient for the gauze. KL= i 8.1mm V = 1.5 m/s Water Gauze...
-
Inventoriable CostsError Adjustments Werth Company asks you to review its December 31, 2010, inventory values and prepare the necessary adjustments to the books. The following information is given to...
-
Consider the information in Question 7. In Question 7, Peterson Law asks Executive Lawn to provide $100 of landscape maintenance. Executive Lawn provides the service on April 10. Consider three...
-
Positive work is done on a system containing positively and negatively charged particles. All work goes into changing the electric potential energy of the system. What can be said about the electric...
-
Multiple Choice. Choose the best answer. 1. Which of the following activities would always indicate that an auditors independence has been impaired? a. Providing advice on establishing an internal...
-
(a) During the audit of the Weak Bank (W), RBI has suggested that the Bank should either merge with another bank or may close down. Strong Bank (S) has submitted a proposal of merger of Weak Bank...
-
For each information request below, formulate a single SQL query to produce the required information. In each case, you should display only the columns requested. Be sure that your queries do not...
-
How could this new information on Dorf's actual recycling program affect Jackie's perception of the company she works for? What impact could this have on her overall performance? Are her personal...
-
The following table shows unemployment and inflation rates for Canada during the 19721982 period: a) Plot Canadas unemployment rates during this period. On the same graph, draw a horizontal line at...
-
What would happen to revenue from seignorage if the inflation rate was very high? check Equation 8 and assume a quickly rising price level. M/P = (M/P) (8)
-
From a risk perspective, how is a forward contract different from a futures contract?
-
What is the rationale for the move from incurred loan provisioning method to the expected loan provisioning method? What are the pros and cons of each method?
-
Suppose Nicoles yearly income is $5,000 when she is fifteen, $35,000 when she is twenty-five, and $70,000 when she is fifty (these are all present value measures of future income). Assume that...
-
Kate takes her friends Allie and Irene to a restaurant. WhenKate wants to pay, she discovers that she does not have her pursewith her. Allie agrees to pay the bill, but she suspects that Katewill not...
-
What are the main distinctions between the different schools of legal interpretation?
-
Mary paid $2,000 of state income taxes in 2012. The total sales tax she paid during 2012 was $5,500, which included $3,000 for the cost of a new car. How should Mary treat the taxes paid on her 2012...
-
On February 2, 2012, Alexandra purchases a personal computer for her home. The computer cost $3,000. Alexandra uses the computer 80 percent of the time in her accounting business, 10 percent of the...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1 and 2. On September 1, Irene opened a retail store that specializes in sports car...
-
Presented below is selected information related to Tsui Repairs at December 31, 2025. Tsui reports financial information monthly (amounts in thousands). a. Determine the total assets of Tsui Repairs...
-
Explain the career opportunities in accounting.
-
Collins Computer Timeshare entered into the following transactions during May 2025. 1. Purchased computers for R\($20,000\) from Digital Equipment on account. 2. Paid R\($4,000\) cash for May rent on...
Study smarter with the SolutionInn App