I am getting getting UnboundLocalError: local variable referenced before assignment error while trying to run this code. As per LEGB rule this should run fine.
def xyz():
count = 1
def xyz_inner():
count += 1
print count
xyz_inner()
print count