Bisix

grouping

May 8th, 2022 (edited)
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. a = {}
  2. for item in mechs:
  3.     tc = item['type_code']
  4.     if not tc in a:
  5.         a[tc] = []
  6.    
  7.     a[tc].append(item)
  8.  
  9.  
  10. print(a['GAT'])
Add Comment
Please, Sign In to add comment