bit of a strange question, but I was trying to come up with different ways to get around this.
Let's say I have the following Dictionary:
dict={ 'Animal':['Cat', 'Dog', 'Ocelot'], 'Humans':['Jack', 'Jill', 'Frank'], 'Fruit':['Apple', 'Orange', 'Banana'] } Is there a way to access just the third element of every key? The output being 'Ocelot' 'Frank 'Banana'
I know that the notation for single key is Dictionary(KEY)[ITEM PLACE] but is there a way to do this without specifying the key?
Thanks
[item[2] for item in d.values()](you shouldn't usedictas a variable name...it overwrites the builtindict).