Getting math scores (Dictionary inside dictionary)
Arie van Wingerden
xapwing at gmail.com
Tue Nov 24 07:23:56 EST 2015
Hi Mark, what use would that have? Please show your code ...
2015-11-24 13:15 GMT+01:00 Mark Lawrence <breamoreboy at yahoo.co.uk>:
> On 24/11/2015 11:04, Cai Gengyang wrote:
>
>> results = {
>> "gengyang": { "maths": 10, "english": 15},
>> "ensheng": {"maths": 12, "english": 10},
>> "jordan": {"maths": 9, "english": 13}
>> }
>>
>> How do you get gengyang's maths scores ?
>>
>> Thank you ...
>>
>>
> One way is to delete the scores for ensheng and jordan, only leaving those
> for gengyang, then extract the maths score.
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list