Computer Science, asked by spinz6998, 6 months ago

read a text file line by line and display each word seperated by a #

Answers

Answered by valeriy69
2

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

with open("file.txt") as f:

for line in f:

new_words = [word + "#" for word in line.split()]

print("".join(new_words))

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

Similar questions