Write a Python program according to the task, using modules of the standard library: os, os.path and pickle. Provide processing of the specified

Joined
May 28, 2022
Messages
7
Reaction score
1
Exceptions: Provide for handling of all exceptions related to file creation/writing/reading.
Task: Create a text file and write the text to it. Then replace the first letter of each word with a capital letter in the file.
 
Joined
Nov 4, 2022
Messages
4
Reaction score
2
Hey you could use something like the below which takes input and applies the appropriate case before writing to a text file.

Python:
while True:
    txt = input("Enter Text: ").title()
    with open("Ouput.txt", "a") as myfile:
        myfile.write(txt + "\n")
Code:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top