Python/basics.py
2020-02-05 14:09:20 +00:00

7 lines
188 B
Python

def countstring(character, filepath):
myfile = open(filepath)
content = myfile.read()
myfile.close()
return(content.count(character))
print(countstring("a", "fruits.txt"))