【求助】local variable 'xxx'referenced before assignment
def a():
test={'a':123,'b':456}
for item in test:
if item.name == 'a':
xxx=item.name+'='+item.value
a=xxx
def b()
……
# python version:3.2
# -*- coding:gbk -*-
test = {'a':123, 'b':456}
for item in test:
if item == 'a':
xxx = item + '=' + str(test[item])
def a():
test = {'a':123,'b':456}
for item in test:
if item == 'a':
xxx = item + '=' + str(test[item])
return xxx
def a():
test = {'a':123,'b':456}
for item in test:
if item == 'a':
return item + '=' + str(test[item])