I have written the following code which gives different output when saved as a .py file and run and on the Python interpreter.
Output when saving as .py file and running through command prompt:
2122603390032 2122603390032 2122603390032
All memory addresses are same.
Output via interpreter:
2351093736464 2351093736464 2351093736304
Last memory address is different.
Why is this happening? I am on Python 3.7.4.
What are the differences when running on the interpreter and when running a .py file.
1 2 3 4 |
a = 100000 b = a c = 100000 print ( id (a), id (b), id (c)) |
2122603390032 2122603390032 2122603390032
All memory addresses are same.
Output via interpreter:
2351093736464 2351093736464 2351093736304
Last memory address is different.
Why is this happening? I am on Python 3.7.4.
What are the differences when running on the interpreter and when running a .py file.