constructors

Constructors

class NumberComplex:
    class ComplexNumbers:
        def __init__(self,realnum = o,i = o):
            self.real = realnum
            self.imaginarynum = i
        def getData(self):
            print("{}+{1}j".format(self.realnumber,self.imaginarynum))
complex1 = NumberComplex(2,3)
complex1.getData()
complex2 = NumberComplex(5)
complex2.attribute = 10
print((complex2.realnumber, complex2.imaginarynumber, complex2.attribute))
complex1.attribute