3 odpowiedzi
+ 3
I think by doing this, you'll Overwrite the value of that variable and the previous memory location which you allocated to that variable won't change.
But you'll miss the previous value.
+ 3
the old data 10 is garbage collected if no name still refers to it
+ 2
Try it out yourself with this code:
a = 10
print(id(a))
a = 'not ten'
print(id(a))
b = 'not ten'
print(id(b))
b = 10
print(id(b))
I think the variable will stick around for some time.