class Dog:
breed='German'
def __init__(self,name,age):
self.name=name
self.age=age
d1=Dog('fluffy',10)
d2=Dog('pookie',5)
d1.breed='Pitbull'
print(d1.breed)
print(d2.breed)
output-
Pitbull
German
I created a class variable breed and later on i tried to change the value of it by using the instance d1 and as we know that only single copy of class variable is available so effect should have been visible in all the copies but the same does not hold true here,why?