Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~9K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Sunciti

I have a nested dictionary which looks like: { A:{I:{key1:value1,key2:value2}, II:{key1:value2, key2:value5, key3:value6}}, B:{I:{key1:value1,key2:value2}, III:{key1:value2, key2:value5, key3:value6} IV:{key1:value9, key2:value7, key3:value8}}, C:{V:{key1:value11,key2:value22}, VI:{key1:value12, key2:value15, key3:value16} VII:{key1:value19, key2:value17, key3:value18}} } My objective is to retrieve the keys ( A,B,C and I,II,III,IV,V,VI,VII) for the occurences of a value. So for example, if I …

Member Avatar for TrustyTony
0
1K
Member Avatar for Sunciti

Hi - I'm a rookie programmer. Could somebody explain how I can append a nested list of the form: List = [[Name1,[Detail-1,Counter-1],[Detail-2,Counter-2].....] [Name2,[Detail-1,Counter-2],[Detail-2,Counter-2].....] ................................................. ] My code is : def program(List, Name, Detail): for entry in List: if entry[0] == Name: entry[1].append([Detail,Counter]) return [B][I] List.append ([Name,[Detail]]) for entry in index: …

Member Avatar for misokolsky
0
8K
Member Avatar for Sunciti