Aquí es mi función:Python: iteración a través de un diccionario me da "objeto int no Iterable"
def printSubnetCountList(countList):
print type(countList)
for k, v in countList:
if value:
print "Subnet %d: %d" % key, value
Aquí está la salida cuando la función es llamada con el diccionario que se le pasa:
<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
¿Algunas ideas?
Tan simple, pero funcionó. ¡Gracias! – Dan