In range In id Out 158453516 In In 10 id Out 10 158096716 In 11 range

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
In [7]: l = range(5)
In [8]: id(l)
Out[8]: 158453516
In [9]: l = []
In [10]: id(l)
Out[10]: 158096716
In [11]: l = range(5)
In [12]: id(l)
Out[12]: 158453516
In [13]: l[:] = []
In [14]: id(l)
Out[14]: 158453516