Answer the header, the difference between + and "append":
[11, 22] + [33, 44,]
will provide you with:
[11, 22, 33, 44]
and.
b = [11, 22, 33]
b.append([44, 55, 66])
will provide you
[11, 22, 33 [44, 55, 66]]
Error response
This is because when you assign a variable in scope, this variable becomes local to that scope and the shadow of any similar named variable in the outer scope
temp+=[j] temp = temp +[j]. temp . . python.
.:)