Guest User

Untitled

a guest
Oct 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import json
  2.  
  3. def prettyPrint(dct):
  4. print(json.dumps(dct, indent=4, sort_keys=True))
  5.  
  6.  
  7. if __name__ == "__main__":
  8. sample = {'name':'Jatin K Malik', 'age':25, 'id':1299, 'address':'Delhi, India', 'phone':9999999999, 'hobbies':'Code'}
  9. prettyPrint(sample)
  10.  
  11. #####################
  12. #Output:
  13. #{
  14. # "address": "Delhi, India",
  15. # "age": 25,
  16. # "hobbies": "Code",
  17. # "id": 1299,
  18. # "name": "Jatin K Malik",
  19. # "phone": 9999999999
  20. #}
Add Comment
Please, Sign In to add comment