What is the output of the following code ?
class A: def __init__(self): self.X = 10 a = A() a.X = 20 delattr(a, 'X') print(a.X)
20
10
None
AttributeError: 'A' object has no attribute 'X'
delattr(a, 'X') - deletes attribute X reference from object "a" .
So it will raise the error
Comment here: