- keys() - dict_keys type
- values() - dict_values
- items() - tuple - dict_items
for key, value in dict.items(): blabla
Python Dictionary notion
Python Dictionary Usages
Subset
a = {'id': '123', 'type': 'admin', 'status': 'active'} b = {'id': '123', 'type': 'admin'} # To check if b is a subset of a: result = b.items() <= a.items() print(result) # Output: True
dict[key] kill program when there is no key, but get(key) return none (or key in dict)
PyPrnt - prnt beauty list and dictionary