Post


@PythonPr 1. a = [1, 2, 3] a new list is created for variable a
2. b = a, this doesn't create a new list for variable b but rather references the list objects of var a
3. a = [4, 5, 6], a new list is created for Var a but variable b still references the original list
4. A. is the output
English

B = 123456 for me. The real answer is where and what are you coding? It matters where you are coding and where the python script will be used. Maya Python code doesn't care what order the list is in. Who can tell I am an animator? If you're coding in python only and that's your only desire B = 123 (print b) but the answer is know your coding environment where you plan to use your code or you would get the incorrect output or an error
English

@PythonPr C. b is a reference to the memory allocation of a. Changing a doesn’t change that b is a reference to a.
English

@PythonPr How would it be if after a:456 we get a new line b=a?
English




















