title: Store words of file in dictionary
body: <p>I want to store the words of a text file in a dictionary. </p>
  
  <p>My code is</p>
  
  <pre><code>   word=0
     char=0
     i=0
     a=0
     d={}
     with open("m.txt","r") as f:
        for line in f:
            w=line.split()
            d[i]=w[a]
            i=i+1
            a=a+1
            word=word+len(w)
            char=char+len(line)
            print(word,char)
    print(d)  
  </code></pre>
  
  <p>my text file is</p>
  
  <pre><code> jdfjdnv  dj g gjv,kjvbm
  </code></pre>
  
  <p>but the problem is that the dictionary is storing only the first word of the text file .how to store the rest of the words.please help</p>