Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

Saturday, September 16, 2023

FILE WORD SEARCHER

SAVE FILE IN PYTHON FOLDER

CodeDrinc Test File

f=open("CoDrinc.txt")

fr=f.readline()

w=input("Enter the word to search = ")

s=0

p=0

while fr:

    c=0

    for i in fr.split():

        if w==i:

            p=1

            print(w,"found at",c,'column in line',s)

        else:

            c+=1

    fr=f.readline()

    s+=1

if p!=1:

    print("Word not found")

f.close()

OUTPUT