1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paraphin [41]
4 years ago
13

Write a program that asks the user for the names of two files. The first file should be opened for reading and the second file s

hould be opened for writing. The program should read the contents of the first file, change all characters to uppercase, and store the results in the second file. The second file will be a copy of the first file, except that all the characters will be uppercase. Use Notepad or another text editor to create a simple file that can be used to test the program.
Computers and Technology
1 answer:
Luda [366]4 years ago
4 0

Answer:

The solution code is written in Python 3

1. output = ""  

2. with open("text1.txt") as file:  

3. data = file.readlines()  

4.  

5. for r in data:  

6. output += r.upper()  

7.  

8. with open("text2.txt", "w") as file:  

9. file.write(output)

Explanation:

Firstly, let's ready a variable output to hold the read data from the first text file (Line 1).

Next, use open function to create a file stream object and use its readlines() method to read all rows of data from text1 (Line 2 -3)

Next create a for loop to traverse through every row of the read data and use upper() function to change all characters in the current row to uppercase and append it to output variable.  

Once the entire output string is ready, use open function again to create a file stream object but add "w" as second parameter of the open function (Line 8).  

Lastly, use write method to copy the uppercase text held by the output variable, to the new file, text2 (Line 9).

You might be interested in
There are many careers within the IT industry. _____ are responsible for organizing a company's data, making sure all the data i
devlian [24]
C. database administrators are responsible for organizing a company's data making sure all the data is accurate' available' and secure
5 0
3 years ago
Jim is an experienced security professional who recently accepted a position in an organization that uses Check Point firewalls.
Contact [7]

Answer: D) CCSA

Explanation: THE CHECKPOINT CCSA(CERTIFIED SECURITY ADMINISTRATOR) is a computer based certification offered by different Computer Institutions in order to equip computer experts or systems engineers on the activities or process or knowledge needed to enhance the security domain of computer systems.

Check Point Firewall is a component of the Software Blade architecture which provides advanced firewall features like VPN and mobile device connectivity.

5 0
4 years ago
It is easier to make an object move across the screen by using the tweening function rather than creating each individual frame
Vesna [10]
Uhhhh I believe it’s true if it’s wrong I’m srry ....
3 0
3 years ago
IF ANSWER I WILL BE REALLY HAPPY
butalik [34]

Answer:

C.

Explanation:

7 0
3 years ago
Read 2 more answers
Write a program to find the sum of given series: (a) S = 1 + (1/2) + (1/3) + ...... + (1/20)
Snowcat [4.5K]

total = 0

numerator = 1

denominator = 1

while denominator != 20:

   total += numerator/denominator

   denominator+=1

print(total)

I wrote my code in python 3.8. I hope this helps.

3 0
3 years ago
Other questions:
  • Why is it important to begin development of a software solution with a programming design in place? A programming design summari
    6·1 answer
  • Most input/output devices communicate with components inside the computer case through a wireless connection or through cables a
    8·1 answer
  • From the Start screen, you can A. access recently opened Excel workbooks. B. create a document from a template. C. create new bl
    12·2 answers
  • Which of the following statements is true?
    10·1 answer
  • (Display nonduplicate words in ascending order)
    11·1 answer
  • A copy of the copyrighted work must be exactly the same as the original to infringe a copyright.
    9·1 answer
  • Which of the following is true of lossy and lossless compression algorithms?
    6·1 answer
  • Yo, my Lenovo laptop keeps showing this screen but I can't sign in, can someone help me?
    5·2 answers
  • Which of the following statements is FALSE?
    10·2 answers
  • Question 1 (1 point)
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!