Computer Science, asked by vishalrawal916, 4 months ago

Aditi has used a text editing software to type some text. After saving the article as WORDS.TXT, she

realised that she has wrongly typed alphabet J in place of alphabet I everywhere in the article.

Write a function definition for JTOI() in Python that would display the corrected version of entire

content of the file WORDS.TXT with all the alphabets "J" to be displayed as an alphabet "I" on screen.

Note: Assuming that WORD.TXT does not contain any J alphabet otherwise.

Example:

If Aditi has stored the following content in the file WORDS.TXT:

WELL, THJS JS A WORD BY JTSELF. YOU COULD STRETCH THJS TO BE A SENTENCE

The function JTOI() should display the following content:

Answers

Answered by jai696
6

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def JTOI(file):

with open(file) as f:

for line in f:

print(line.replace("J", "I"))

JTOI("WORDS.TXT")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions