Here\'s my function:
def printSubnetCountList(countList):
print type(countList)
for k, v in countList:
if value:
print \"Subnet %
The for k, v syntax is a short form of the tuple unpacking notation, and could be written as for (k, v). This means that every element of the iterated collection is expected to be a sequence consisting of exactly two elements. But iteration on dictionaries yields only keys, not values.
The solution is it use either dict.items() or dict.iteritems() (lazy variant), which return sequence of key-value tuples.