这是我的函数:
def printSubnetCountList(countList):
print type(countList)
for k, v in countList:
if value:
print "Subnet %d: %d" % key, value
当函数使用传递给它的字典进行调用时,以下是输出结果:
<type 'dict'>
Traceback (most recent call last):
File "compareScans.py", line 81, in <module>
printSubnetCountList(subnetCountOld)
File "compareScans.py", line 70, in printSubnetCountList
for k, v in countList:
TypeError: 'int' object is not iterable
有什么想法吗?