类的相关定义

class Complex:
def __init__(self, realpart, imagpart):
self.r = realpart
self.i = imagpart
x = Complex(3.0, -4.5)
print(x.r, x.i)

原文地址:https://www.cnblogs.com/yukit/p/13668792.html