Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyRef
#python 3.6.9 #PyRef #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #refcount() function code credit goes to pythontutorial.net # rest of the code is modified and created by Rezaul Hoque on March 10,2022; import ctypes def refcount(address): return ctypes.c_long.from_address(address).value numbers = [1,2,3] alnum = numbers print('Address of original variable') print(id(numbers)) print('Address of alias variable') print(id(alnum)) numbers=[5,6,7] print('After reassigning the values of original variable') print('Address of original variable') print(id(numbers)) print('Address of alias variable') print(id(alnum)) print('Reference count of original variable:') print(refcount(id(numbers))) print('Reference count of alias variable:') num=numbers num2=numbers print(refcount(id(numbers)))
run
|
edit
|
history
|
help
0
python, Polymorphie, attributes, setter and getter the pythonic way (V3)
Python code
mbti
abc
linked_lists_2
Fibonacci to the Nth number
(P2) Ciągi 2
If else if in 2 ways
16jan
PYTHON 3