Advertisement
eliransh

Untitled

Nov 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import json
  3.  
  4. def main():
  5. """
  6. Add Documentation here
  7. """
  8. pass # Replace Pass with Your Code
  9. winners = """
  10. {
  11. "recipes": {
  12. "shabloli_vanil": {
  13. "mitzrahim": {
  14. "flowr": "200",
  15. "suger": "150",
  16. "yeast": "20",
  17. "butter": "20"
  18. }
  19. },
  20. "kogelof": {
  21. "mitzrahim": {
  22. "tzimok": "100",
  23. "suger": "200",
  24. "flow": "110",
  25. "milk": "200",
  26. "suger_poweder": "20"
  27. }
  28. },
  29. "choclate muffin": {
  30. "mitzrahim": {
  31. "choclate": "200",
  32. "flow": "200",
  33. "suger": "100",
  34. "butter": "75"
  35. }
  36. }
  37. }
  38. }"""
  39. json_obj = json.loads(winners)
  40. for item in sorted(json_obj['recipes'],reverse=True):
  41. print(item + ":")
  42. for key, value in json_obj['recipes'][item]['mitzrahim'].iteritems():
  43. print(key + ":" + " " + value)
  44.  
  45. if __name__ == '__main__':
  46. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement