菜鸟也来学python 笔记5 - python字典
?
目前已经学习了字符串,列表和序列了。下面的是字典类型~>>> type(dict1)<class 'dict'>>>> ?>>> dict1['one'] = 'father'>>> dict1['two'] = 'mother'>>> dict1['three'] = 'son'>>> print (dict1){'three': 'son', 'two': 'mother', 'one': 'father'}>>> >>> inventory = {'apples': 430, 'bananas': 312,'oranges': 525, 'pears': 217}>>> print (inventory){'pears': 217, 'apples': 430, 'oranges': 525, 'bananas': 312}>>> del inventory['pears']>>> print (inventory){'apples': 430, 'oranges': 525, 'bananas': 312}>>> ??
统计字符串
?
?
?
?