Dec-23-2018, 09:44 PM
(Dec-23-2018, 09:17 PM)muhammedkhairy Wrote: it is the same but I use here Append which mutate the original list but also inside the function, So why here I see the mutated list not the original
It's not the same. When you append, you modify the original list. As stulis notes, mylist is pointing to the location of list2. In your original code, you created a new list by adding two lists together. This does not modify the original list. In that code, my_list was pointing to the location of list2, but then you reassign it (with the = assignment operator) to the location of the new list you just created by adding.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures