Write a python class named complex with constructor accepting real and imaginary parts


Topic: Write a python class named complex with constructor accepting real and imaginary parts

Solution

class Complex:
    def __init__(self, realpart, imagpart):
        self.r = realpart
        self.i = imagpart



List all Python Programs