Skip to content

Pass nested dictionary location as parameter in Python

If I have a nested dictionary I can get a key by indexing like so: Am I able to pass that indexing as a function parameter? Obviously, this is incorrect, I get TypeError: list indices must be integers, not str. How can I do it correctly? Answer You can use reduce (or functools.reduce in python 3), but that wo…

Google foobar gearing_up_for_destruction

I was doing the google foobar challenge but ran out of time on the following challenge i am trying to see what i did wrong. Challenge As Commander Lambda’s personal assistant, you’ve been assigned the task of configuring the LAMBCHOP doomsday device’s axial orientation gears. It should be pr…