Good afternoon, respected experts. I am learning Python and Json.
There is such a json file:
{ "рубашка":{"kol": 32, "type": "шт"}, "брюки":{"kol": 22, "type": "шт"}, "носки":{"kol": 60, "type": "пара"}, "трусы":{"kol": 45, "type": "пара"}, "ботинки":{"kol": 21, "type": "пара"}, "кеды":{"kol": 29, "type": "пара"}, "сапоги":{"kol": 28, "type": "пара"}, "шляпа":{"kol": 20, "type": "шт"}, "кепка":{"kol": 14, "type": "шт"}, "пальто":{"kol": 15, "type": "шт"}, "футболка":{"kol": 30, "type": "шт"} } The decoded output is obtained:
{'шляпа': {'kol': 20, 'type': 'шт'}, 'сапоги': {'kol': 28, 'type': 'пара'}, 'кепка': {'kol': 14, 'type': 'шт'}, 'пальто': {'kol': 15, 'type': 'шт'}, 'футболка': {'kol': 30, 'type': 'шт'}, 'брюки': {'kol': 22, 'type': 'шт'}, 'кеды': {'kol': 29, 'type': 'пара'}, 'носки': {'kol': 60, 'type': 'пара'}, 'ботинки': {'kol': 21, 'type': 'пара'}, 'трусы': {'kol': 45, 'type': 'пара'}, 'рубашка': {'kol': 32, 'type': 'шт'}} I decode it. And you need to count the number of piece goods and the pair, and the number of all goods. So the algorithm is not clear a little, how to check and access the sub-dictionary, that is, it will get access (and check) type: 'pc'.