w3ajay

tally tutorial point, ms word 2013, ms excel 2013, ms powerpoint 2010,ccc question with answer in hindi 2021, Tally Prime in hindi , tally prime,Python,in python,programming in python,python

Thursday, July 18, 2024

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



 # Read a text file line by line and display each word separated by a #

f=open("ram.txt")

data=f.readlines()

for line in data:

    word=line.split()

    for i in word:

        print(i,"#",end='')

f.close()

Output






No comments:

Post a Comment

for more information please share like comment and subscribe