ich einige haben ...Haben Sie Probleme mit Python
[{"countryname": "Republic of Tunisia", "project_name": "TN: DTF Social Protection Reforms Support", "lendprojectcost": 5700000},
{"countryname": "Republic of Tunisia", "project_name": "Tunisia: Ecotourism and Conservation of Desert Biodiversity", "lendprojectcost": 9050000},
{"countryname": "Republic of Tunisia", "project_name": "Tunisia - Communications for policy reforms", "lendprojectcost": 600000},
{"countryname": "Republic of Tunisia", "project_name": "Tunisia - Governance, Opportunities and Jobs DPL", "lendprojectcost": 500000000}]
Ich möchte:
[{"countryname": "Republic of Tunisia", "project_name":all projects, "lendprojectcost":sum(..) }]
, wie kann ich dies tun? Ich habe Python/Flask/MongoDB verwendet.
Bitte Machen Sie Ihren Code python-aussehend, mit Variablennamen. Wir sind alle alte, kurzsichtige, glastragende Kerle, und rohes JSON zu zerlegen tut wirklich weh. – DyZ
Verwenden Sie eine 'for' -Schleife, um es zu tun. – furas
Wie willst du deine 'all_projects': als Liste, als String, etc? – DyZ