0

https://code.sololearn.com/cvqLh5ERuO29/?ref=app

Can i know how the output is coming

24th Jan 2022, 6:56 AM
Jothika
Jothika - avatar
3 Answers
+ 2
Your list contains 3 copies of the same `list` object, and adding item to either one will reflect on the other two, cause they all refer to the same object. Please move your code link into Description. Links don't work if you put them in question title ☝
24th Jan 2022, 7:04 AM
Ipang
+ 2
I Still didn't get you Ipang
24th Jan 2022, 7:06 AM
Jothika
Jothika - avatar
+ 1
Imagine you are a magician on a stage. You have a big magic box and another magic box inside. You can cast a spell to make people believe there are 3 magic boxes inside, but there is actually only one. So whatever you put in the magic box inside, will show up in the other two boxes which are not real.
24th Jan 2022, 7:18 AM
Ipang