UnboundLocalError: local variable 'msg' referenced before assignment code example
Example: UnboundLocalError: local variable 'r' referenced before assignment
r = 0
list = ['apple','lime','orange']
def list_list(x):
for i in x:
r +=1
print r
list_list(list)