0

I have a list of links which i am getting from BeuitfulSoup object, after links2=links1then i edited links1 ,but links2 got changed as well so i test in IDLE. Example of a list which i want to modify but keep the original one intact, how can i do it?

a=[1,2,3]
b=a
a.append(4)
print b

Output

[1, 2, 3, 4]

i want b to stay [1,2,3]

wishmaster
  • 1,437
  • 1
  • 10
  • 19

0 Answers0