Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views1 page

Solution To Prog

The document contains a Python script that reads a text file named 'Hello.txt' from a specified directory. It splits each line into words and prints each word followed by a '#' character on the same line. Finally, it closes the file after processing all lines.

Uploaded by

monibas27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Solution To Prog

The document contains a Python script that reads a text file named 'Hello.txt' from a specified directory. It splits each line into words and prints each word followed by a '#' character on the same line. Finally, it closes the file after processing all lines.

Uploaded by

monibas27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1) file=open("z:\SHARE FOR FACULTIES\MONICA\practic e\Hello.

txt","r")

lines=file.readlines()
for line in lines:
words=line.split()
for word in words:
print(word+"#",end="")
print("")
file.close()

You might also like