class complexe:
def __init__(self,re,im):
self.z = (re , im)
def nombre(self):
return (self.z[0] , self.z[1])
def __add__(self , other):
return complexe( self.z[0] + other.z[0] , self.z[1] + other.z[1] )
def __sub__(self , other):
return complexe( self.z[0] - other.z[0] , self.z[1] - other.z[1] )
def __mul__(self , other):
return complexe( self.z[0] * other.z[0] - self.z[1] * other.z[1] , self.z[0] * other.z[1] + other.z[0] * self.z[1] )
def __eq__(self , other):
return self.z[0] == other.z[0] and self.z[1] == other.z[1]
def module(self):
return (self.z[0] ** 2 + self.z[1] ** 2) ** 0.5