title: Summing the amount of times a word appears in a list, and putting the value and word in a dictionary?
body: <p>I have an assignment where I have to create a module with a list of functions, where a string is written to a file. The part I'm stuck at is where I have to take the amount of times a word appears in the input string, and add it to a dictionary. The key of the dictionary will be the word, and the value will be the amount of times the word appears in the string.</p>
  
  <pre><code>def word_freq_dict(): # function to count the amount of times a word is in the input string
     file = open("data_file.txt", 'r')
     readFile = file.read() #reads file
     words = readFile.split() #splits string into words, puts each word as an element in a list
  </code></pre>
  
  <p>The other functions work, I made sure of it. What I have so far is taking the words and putting them into a list. I want to sum the amount of times each word appears in the list, and add it to a dictionary with the word being the key and the amount of times it appears being the value. This function does not return anything.</p>