From this question:
>>> t_list = [('a', 10, 98), ('b', 234, 65), ('c', 459, 5)]
>>> t_dict = {a:{b:c} for a,b,c in t_list}
>>> t_dict
{'a': {10: 98}, 'c': {459: 5}, 'b': {234: 65}}
And I can call values based on the first element such as:
>>> t_dict['a']
{10: 98}
But how would I access individual values based on the key? Such as 10
or 98
. I am expecting something like this: t_dict['a'][0]
. I have tried using split()
and slicing it but no luck.