d = {
"local": {
"count": 1,
"health-beauty": {
"count": 1,
"tanning": {"count": 1}
}
},
"nationwide": {"count": 9.0},
"travel": {"count": 0}
}
इस उदाहरण में "nationwide"
सबसे बड़ा है।नेस्टेड शब्दकोश में अधिकतम खोजें
d = {'travel': {'count': 0}, 'local': {'count': 1, 'health-beauty': {'count': 1, 'tanning': {'count': 1}}}, 'nationwide': {'count': 9.0}}
'प्रिंट अधिकतम पर देख रहा था (घ, कुंजी = लैम्ब्डा एक्स: एक्स [1]) ' – AlexZ
आपको स्थानीयतम स्थान बनाना चाहिए था ... क्योंकि यह कोई जवाब नहीं मिलेगा ... –
यदि" कमाना "10 था, और आपको इसे पकड़ने की आवश्यकता है, आपको शब्दकोश को फ़्लैट करने की आवश्यकता हो सकती है। इस तरह कुछ कोशिश करें [http://stackoverflow.com/questions/6027558/flatten-nested-python- शब्दकोश-compressing-keys](httpoverstow.com/questions/6027558/flatten-nested-python- शब्दकोश- संपीड़न-कुंजी) –