Need help on 6.00 Handout, Lecture 5:
Here are the lists that I am looking at:
1.
L1 = [2]
L2 = [L1, L1]
print 'L2 =', L2
# L2 = [[2], [2]]
2.
L1[0] = 3
print 'L2 =', L2
# L2 = [[3], [3]]
3.
L2[0] = 'a'
print 'L2 =', L2
# L2 = ['a', [3]]
4.
L1 = [2]
L2 = L1
L2[0] = 'a'
print 'L1 =', L1
print 'L2 =', L2
# L1 = ['a']
# L2 = ['a']
I understand everything up to number 4 (correct answers start with a #). I can't understand why L1 = 'a' here. I was expecting L1 to be equal to [2].
Could someone write down an explanation about what is going on in part 4 of the

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.