Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
Help with nested dictionaries (I think) Need help pulling out specific value (have done google searching to no avail)
Post Body

Ok, so i’m using an api that returns a dictionary that looks something like this:

random = {'random': 332, 'Id': 11, 'Mode': 'CLASSIC', 'Type': 'CUSTOM', 'participants': [{'Id': 100, 'Id': 14, '2Id': 4, 'cId': 1, 'IconId': 4245, 'Name': 'agaming83', 'bot': False, 'sId': 'F0IWXeoB', 'gCustomObjects': [], 'perks': {'perkIds': [8351, 8304, 8345, 8347, 8014, 9104, 5008, 5008, 5002], 'pStyle': 8300, 'pSubStyle': 8000}}], 'observers': {'encryptionKey': 'HNI11xmLmb6p o2uDNKE/oFJffZDNDvb'}, 'formId': 'A1', 'bChamp': [], 'StartTime': 0, 'Length': 0}

I want to get the Name agaming83 from this dict. I have tried things like:

Print(random['participants']['Name'])

or something like this

for key, value in random.items() :

print(key, value)

and nothing extracts the s pecific thing I want (the value agaming83). Any help would be awesome.

I am able to do something like this:

random2 = test[‘participants’]print(random2)

and am able to get a everything from the participants key, but I want to get just the specific value of agaming83 from the dict

If I made something confusing let me know and i’ll clarify

(side note please be gentle I am very new to python)

Author
Account Strength
90%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,701
Link Karma
2,296
Comment Karma
350
Profile updated: 3 days ago
Posts updated: 10 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago