Python 字典和列表的问题
发布网友
发布时间:2022-08-21 01:51
我来回答
共1个回答
热心网友
时间:2023-11-15 05:13
Type "help", "copyright", "credits" or "license" for more information.
>>> alpha = {'a':['a','aa','aaa'], 'b':['b', 'bb', 'bbb'], 'c': ['c','cc','ccc']}
>>> number = {'1':['1','11','111'], '2': ['2','22','222'], '3': ['3', '33', '333']}
>>> newdict = dict(
... alpha = alpha,
... number = number,
... )
>>> newdict
{'alpha': {'a': ['a', 'aa', 'aaa'], 'c': ['c', 'cc', 'ccc'], 'b': ['b', 'bb', 'bbb']}, 'number': {'1': ['1', '11', '111'], '3': ['3', '33', '333'], '2': ['2', '22', '222']}}
>>>