Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bread_sauce = {'onions': 2,
- 'onions': 3,
- 'bay leaf' : 1,
- 'peppercorn' : 4,
- 'mace tsp': 1/4,
- 'milk' : 800,
- 'breadcrumbs': 150,
- 'butter' : 30,
- 'onions': 1,
- 'double cream tbsp' : 2}
- #s_dict = {}
- def merge(dicti):
- s_dict = {}
- for key, value in dicti.items():
- print(key, value)
- if not key in s_dict:
- s_dict[key] = [value]
- print(s_dict)
- else:
- s_dict[key].append[value]
- print(s_dict)
- return s_dict
- b = merge(bread_sauce)
Add Comment
Please, Sign In to add comment