Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- test = defaultdict(dict)
- for item in debitlist:
- if not something:
- test[item[name]]['count'] += 1
- test[item[amount]]['amount'] += test[item[amount]]['amount']
- { "Krishna" : { "count" : totalcount, "amount" : totalamount } }
- from collections import defaultdict
- def floatdict():
- return defaultdict(float)
- test = defaultdict(floatdict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement