[Python] I need someone to help count items from response [json]
$10-30 AUD
I përfunduar
Postuar over 5 years ago
$10-30 AUD
Paguhet në dorëzim
Here's what I need help with:
- I have a program, that looks inside of a response, if it finds an ID matching my list, it will print and save the name I have given the ID. It works well actually, where I need help with is if an ID is found twice, it will only print/save it once, when I'd like it saved twice.
Ideally I'd like it to save it in the following format:
Id1 x1 <found1
Id2 x1 <found1
Id 3 x2,3,4,5 ect <found2,3,4,5, ect
Code being used:
IDs = {'NameHere':'IdHere', 'NameHere':'IdHere', 'NameHere':'IdHere',}
M = [k for (k, c) in sorted([login to view URL]()) if c in [login to view URL]]
print M
^Printing that when used with my requests, will only print items from my list if any are found, I'd like a way implemented to add quantities, saving them with x1, x2, x3 ect.
Ideal output:
Bobx1
Gregx3
Billyx2
Script to test with:
realresponse = {
"cards": [{
"id": 1,
"card_id": 2,
"exp": 0,
"skill_lv": 1,
"released_rate": 0.0,
"awakenings": [],
"unlocked_square_statuses": [],
"created_at": 1546646705,
"potential_parameters": []
}]
}
IDs = {'Bob': '123', 'Billy': '456', 'Greg': '789'}
sample = {'123', '789', '123'}
M = [k for (k, c) in sorted([login to view URL]()) if c in sample]
print M
realresponse is not used, its there to show what a real response I get looks like.
I can provide clearer information privately.
i am gopinath i have 3+ year experience in software development unity3d,android,ios...............................................................................................
Hello, I've read your offer and it seems like a simple task, so it can be done briefly.
I have around 3 years of python experience. I have integrated APIs using json format many times, so what you're asking for is not a problem.
If I understand correctly, multiple instances of the same ID are only being counted as one, right?