标签:highlight python dict logs blog nbsp let emma nts
# create a dictionary students = {"Alice": 24, "Bob": 26, "Clark": 23, "Dan": 28, "Emma": 31} # add entry to a dictionary students[‘Fred‘] = 27 # alter an entry students[‘Alice‘] = 25 # delete entry del students[‘Fred‘] students2 = { "Alice": [‘ID01‘, 24, ‘A-‘], "Bob": [‘ID02‘, 26, ‘B+‘], "Clark": [‘ID03‘, 23, ‘B‘], "Dan": {‘id‘: ‘ID04‘, ‘age‘: 28, ‘grade‘: ‘A‘}, }
标签:highlight python dict logs blog nbsp let emma nts
原文地址:http://www.cnblogs.com/mxyzptlk/p/7172998.html