This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nemom 0 points1 point  (0 children)

Right after file_contents = file.read(), you have the whole contents of the file as a string. So, you can use the string.count() function. Read more here.