0

I am trying to work on this problem but am confused with how to approach it.

I am trying to create a program in python that analyzes a text file and counts how many time various words are used within it.

I understand what I need to do but am still confused with how to set it up. I would appreciate some guidance

2
Contributors
1
Reply
26
Views
4 Years
Discussion Span
Last Post by rrashkin
0

If the file is small enough (and that depends on your memory, usually pretty big) to be read all at one go:

f=open(<text file name>)
strdata=f.read()
f.close()
c=strdata.count("abc")
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.