0

programme to search a word in a file ..

how to seperate words in a file

11th Aug 2017, 3:08 PM
sai kumar
sai kumar - avatar
1 Odpowiedź
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..??
11th Aug 2017, 3:16 PM
sai kumar
sai kumar - avatar