MCPcopy Create free account
hub / github.com/CodeWithHarry/The-Ultimate-Python-Course / __add__

Method __add__

Chapter 11 - PS/04_problem4.py:6–7  ·  view source on GitHub ↗
(self, c2)

Source from the content-addressed store, hash-verified

4 self.i = i
5
6 def __add__(self, c2):
7 return Complex(self.r + c2.r, self.i + c2.i)
8
9 def __mul__(self, c2):
10 real_part = self.r * c2.r - self.i * c2.i

Callers

nothing calls this directly

Calls 1

ComplexClass · 0.85

Tested by

no test coverage detected