यहां मेरा कार्य है:पायथन: एक शब्दकोश के माध्यम से Iterating मुझे "int वस्तु reererable" देता है
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
कोई विचार?
इतना आसान, लेकिन काम किया। धन्यवाद! – Dan