python基础问题总结 TypeError: object() takes no parameters class complex: def _init_(self, realpart, imagpart): self.r = realpart self.i = imagpart x = complex(1.0, 8) print(x.r, x.i) 但是报了以下错误: 原因:init() 写错了 应该为 init() 左右为两个横线 额… ...