Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. from collections import defaultdict
  2. test = defaultdict(dict)
  3. for item in debitlist:
  4. if not something:
  5. test[item[name]]['count'] += 1
  6. test[item[amount]]['amount'] += test[item[amount]]['amount']
  7.  
  8. { "Krishna" : { "count" : totalcount, "amount" : totalamount } }
  9.  
  10. from collections import defaultdict
  11.  
  12. def floatdict():
  13. return defaultdict(float)
  14.  
  15. test = defaultdict(floatdict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement