Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def createDictionary():
  2. newDictionary = { }
  3. with open("file name/location") as myFile:
  4. for line in myFile:
  5. keyval = line.split(",")
  6. key = keyval[0]
  7. val = keyval[1]
  8. x = len(val)-1 # this removes the '\n'
  9. val = val[0:x]
  10. newDictionary[key] = val
  11. print(newDictionary)
Add Comment
Please, Sign In to add comment