Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createDictionary():
- newDictionary = { }
- with open("file name/location") as myFile:
- for line in myFile:
- keyval = line.split(",")
- key = keyval[0]
- val = keyval[1]
- x = len(val)-1 # this removes the '\n'
- val = val[0:x]
- newDictionary[key] = val
- print(newDictionary)
Add Comment
Please, Sign In to add comment