0
programme to search a word in a file ..
how to seperate words in a file
1 Réponse
0
def count_char(text, char):
count = 0
for c in text:
if c == char:
count += 1
return count
filename = input("Enter a filename: ")
with open(filename) as f:
text = f.read()
print(count_char(text, "r"))
wat if we want to search a word..??