Wanted to understand what would be the output of this code:
class BaseClass: def __init__(self): self.a = "GoForGyan" self.__c = "goforgyan" def display(self): print(self.a,self.__c) class Derived(BaseClass): def __init__(self): BaseClass.__init__(self) print(self.__c) obj1 = BaseClass() obj1.display()
Hey, welcome to the ESRI community!
This is a forum specifically for all GIS products of ESRI. If you have nothing to do with that and only have questions about Python, this might not be the best place to ask.
What will be the output? Well, have you tried to run it?
You create a BaseClass object and run its display() method. This method prints two attributes (a & __c) of the object. You don't do anything with the derived class.
The output will be "GoForGyan goforgyan".