## Dictionary List
G046 = {'046-HOST1':'192.168.1.10', '046-HOST2':'10.1.0.1'}
G688 = {'688-HOST1':'8.8.8.8', '688-HOST2' : '123.3.3.3'}
## Group List
GroupList = ['G046', 'G688']
for groupname in GroupList:
print ('Groupname is', groupname) ## prints "G046" and "G688"
print (dict(groupname).keys()) ## <---- error occurs
我想打印所有字典列表中的所有项目。但我收到以下消息:
ValueError: dictionary update sequence element #0 has length 1; 2 is required
有人可以帮忙吗?