Hi everyone, I know what this code does:
1.] My first problem
x = 4 y = x
But what about this one. Why are the same addresses even for this case?
x = 4 y = 4 id(x) 12345678 id(y) 12345678
2.] My second problem
x = 42 y = xx = x + 1 print x
But why is it that in the case of the list, both x and y got the mutation together with the command x[0] = 4 .
What is so different from lists in this behavior?
What makes them act like that? And most importantly, what are the benefits of this behavior?
why the list of edges, variables, tuples have all the properties of each other?
source share