Toggle navigation
English
Chinese
Python Sandbox
Please refer to
this tutorial
to find more details on the following codes.
# # Complex numbers # class complex_number: def __init__(self, re, im): self.re = re self.im = im def absquare(self): return self.re*self.re + self.im*self.im z=complex_number(2,5) print(z.re, z.im, z.absquare())
Run
List