human
Can you provide a Strong reference given the following:
I am working on the file "Section 2 - Advance Python/Chapter S2.12 - Weak Reference, Copy/Weak Reference.ipynb".
The first task is:
Weak Reference:
Non-permanent References to Objects
What is Strong reference
When memory is referenced by a variable, its called strong reference. What that means is that untill all the strong references are removed from the memory location, it is not removed.
Can you write Python program for it?
assistant
#Here is Strong reference
.

a = 101
b = a
print(a, id(a))
print(b, id(b))

del(a)
# print(a, id(a))
print(b, id(b))

del(b)
# print(a, id(a))
# print(b, id(b))

import sys

class MayaHello:
    def __init__(self, lang):
        self.lang = lang
    
    def hello(self):
        if(self.lang == 'hi'):
            return "नमस्ते"
        elif(self.lang == 'de'):
            return "Hallo"
        else:
            return ("Hello")
    
    def __del__(self):
        print("self destruct initiated")
        del self.lang

a = MayaHello('hi')
print(a.hello())
sys.stdout.flush()
b = a 
print(b.hello()) 
sys.stdout.flush()

print(a.hello())