I have a function :
def getvalues():
global avalue
global bvalue
dictt = getresults()
for key , value in dictt.iteritems():
avalue = key
bvalue = dictt[key]
print avalue , bvalue
This prints the value of avalue , bvalue Output:
C123 1
C245 2
C456 2
C565 3
C654 1
but , returning the values outside for loop doesn't iterate over.Like this:
def getvalues():
global avalue
global bvalue
dictt = getresults()
for key , value in dictt.iteritems():
avalue = key
bvalue = dictt[key]
return avalue , bvalue
I need avalue , bvalue to be used outside this function.How can this be done?? If i use return i get the output as
C654 1
I need the same output of above with all avalue , bvalue that i can use in other function