Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. mydict = {}
  2. with open('random.txt','r') as f:
  3. spam = f.readlines()
  4. v = 0
  5. for line in spam:
  6.  
  7. k = line.split()
  8. v +=1
  9. mydict[k] = v
  10.  
  11.  
  12.  
  13. print mydict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement