(Mar-19-2020, 10:53 PM)AnOddGirl Wrote:
Good morning,
Well as all above already mentioned, is your output not that what it should be / expect from your code :)
with
print(d['tax']You only get the the value from the value "tax" in your dict.
Here is a short example how you can access/work through a nested-dict !
config = { "username": "user", "password": "password", "server": "https://website.de", "headers": { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:44.0) Gecko/20100101 Firefox/44.0", "Connection": "keep-alive" } } print(config['headers']['User-Agent'])Will output:
Output:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:44.0) Gecko/20100101 Firefox/44.0
You can count all items(key/value pairs) from a dict with the len() functionHere (How to find length of dictionary values) you have a pretty decent example, which is actually part of that what you need.
Now you only need to call your created function the right way ( with the correct parameter " d " )
All the best :)
Tried to explain it as easy as I could in the morning without giving you the direct solution ...
That are at least the basics. The rest with the unique part is up to you :)
Shouldnt be that hard.