diff --git a/basics.py b/basics.py index 9bcfb6a..e3db141 100644 --- a/basics.py +++ b/basics.py @@ -1,7 +1,4 @@ -def countstring(character, filepath): - myfile = open(filepath) +with open("fruits.txt") as myfile: content = myfile.read() - myfile.close() - return(content.count(character)) -print(countstring("a", "fruits.txt")) \ No newline at end of file +print(content) \ No newline at end of file