I
I
ItzGuyMc2022-01-11 20:41:40
Python
ItzGuyMc, 2022-01-11 20:41:40

How to count how many times a value occurs in JSON?

With requests, I get data like this:

{'status': True, 'data': {'total': 111, 'helper': [{'id': 1, 'user': 'user1', 'helper': 'user2'}], 'all': {'total': 111, 'list': [{'id': 1, 'user': 'user3', 'helper': 'user4'} и т.д.

I need to count how many times 'helper': 'user2' occurs here (not counting the very first helper: 111, 'helper': [{'id': 1...) and add it to a variable, I tried many ways but my head is already boiling, please help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question