I embrace to study Python thorugh the course material of pythoninstitute.org and one of the quizes consist of:
l1 = ["A", "B", "C"]
l2 = l1
l3 = l2
del l1[0]
del l2[:]
print(l3)
I expected ['B'. 'C'] as result of print(l3), meanwhile the correct result is [].
I don't understand why. Could you explain that to me?
To get what I expected that result I had to code as it follows:
l1 = ["A", "B", "C"]
l2 = l1
l3 = l2
del l1[0]
l4 = l2[:]
del l4
print(l3)
Could you explain the difference between the two snippet?