As I know, dynamic arrays (list in Python) move in memory when its size reaches its capacity. And as far as I know the id of an object corresponds to its memory address.
But when appending values to a list many times, its id doesn't change (so it stays in the same place in memory).
Why?
a = []
print(id(a)) # 2539296050560
for i in range(1_000_000):
a.append(i)
print(id(a)) # 2539296050560