python objects confusion
- by james
wow i thought i knew python untill tonight.. what is the correct way to do something like this.. heres my code
a = ["one", "two", "three"]
b = a #here i want a complete copy that when b is changed, has absolutely no effect on a
b.append["four"]
print a #a now has "four" in it..
so basically i want to know, instead of the b = a step, how would i correctly make a copy of a list or dictionary so that when b is changed a does not change along with it.. thanks guys