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

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>)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.