>>> dummy_orders_data = [{'id': 1, 'items': 10, 'day': 'Monday'},
{'id': 5, 'items': 15, 'day': 'Tuesday'},
{'id': 2, 'items': 3, 'day': 'Tuesday'},
{'id': 6, 'items': 15, 'day': 'Friday'},
{'id': 20, 'items': 15, 'day': 'Sunday'}]
>>> sum(1 for order in dummy_orders_data if order['items'] == 15)
3
count = 0
orders = data['data']['orders']
for item_order in orders:
if 'order_crew_group_id' in item_order:
count += 1
print(count)
count = 0
orders = data['data']['orders']
for item_order in orders:
if 'order_crew_group_id' in item_order:
if item_order['order_crew_group_id'] == 2:
count += 1
print(count)