+ 3
Why not color of g.color and Dog.color shud be blue?? Why error is showing in print( g.color) and print (Dog.color)
class Dog: legs = 4 color= blue def __init__(self, name, color): self.name = name g = Dog("Fido", "brown") print(g.legs) print(Dog.legs) Dog.legs = 6 print (g.legs ) print (Dog.legs) print (g.color) print(Dog.color)
2 Antworten
+ 3
dude i thought same but there is error can u fix that error
+ 3
thanx budddy