#6-4
'''
programming_vocabulary={
'str()':'将非字符串值表示为字符串',
'del':'彻底删除一个元素',
'sort()':'对列表进行永久性排序',
'sorted()':'对列表进行临时排序',
'range()':'生成一系列数字',
}
programming_vocabulary['title()']='首字母大写'
programming_vocabulary['lower()']='全部字母小写'
programming_vocabulary['upper()']='全部字母大写'
programming_vocabulary['append()']='在列表末尾添加元素'
programming_vocabulary['insert()']='在列表中插元素'
for key, value in programming_vocabulary.items():
print(key+':\n\t'+value+'.')
'''
from collections import OrderedDict
programming_vocabulary = OrderedDict()
programming_vocabulary['insert'] = '在列表中插元素'
programming_vocabulary['upper'] = '全部字母大写'
for name, vocabulary in programming_vocabulary.items():
print(name.title() + "'s meaning is " + vocabulary)
结果
Insert's meaning is 在列表中插元素
Upper's meaning is 全部字母大写Process finished with exit code 0