Getting math scores (Dictionary inside dictionary)

Cai Gengyang gengyangcai at gmail.com
Tue Nov 24 06:22:41 EST 2015


Great, it works! Thanks a lot ..

>>> results = {
  "gengyang": { "maths": 10, "english": 15},
  "ensheng": {"maths": 12, "english": 10},
  "jordan": {"maths": 9, "english": 13}
  }

>>> print((results["gengyang"])["maths"])
10

On Tue, Nov 24, 2015 at 7:10 PM, Arie van Wingerden <xapwing at gmail.com>
wrote:

> print((results["gengyang"])["maths"])
>
> 2015-11-24 12:04 GMT+01:00 Cai Gengyang <gengyangcai at gmail.com>:
>
>> 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 ...
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>



More information about the Python-list mailing list