Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- phonebook = {
- "name":"Robert",
- "phone":"062055588896"
- }
- # write json file
- with open("phonebook.json", "w") as f:
- json.dump(phonebook, f)
- # read json file
- with open("phonebook.json") as f:
- data = json.load(f)
- print( data.get("name") )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement