1

I don't want to initialize the variable r and c again in the GE class. Instead, I want to use the __init__ method of Employee. How should I do it?

class Employee:
    def __init__(self,r,c):
        self.r = r
        self.c = c
        print(r"Complex no =",self.r,"+",self.c,"i")
        print("")

class GE(Employee):
    def __init__(self,r,c,promotion="yes"):
        super(r,c).__init__()
        #self.promotion = "yes"
        print(self.promotion)
Cœur
  • 37,241
  • 25
  • 195
  • 267

0 Answers0