Here is my code.
rst2 = []
def a(n):
return rst2.append(1)
a = map(a, [2, 2])
print(rst2)
Can somebody tell me why the rst2[] return a blank?
I tried to change the rst2 to global rst2, but it does not work.
Here is my code.
rst2 = []
def a(n):
return rst2.append(1)
a = map(a, [2, 2])
print(rst2)
Can somebody tell me why the rst2[] return a blank?
I tried to change the rst2 to global rst2, but it does not work.