本文共 244 字,大约阅读时间需要 1 分钟。
attributes.py
class Point: passp1 = Point()p2 = Point()p1.x = 5p1.y = 4p2.x = 3p2.y = 6print(p1.x, p1.y)print(p2.x, p2.y)
first_method.py
class Point: def reset(self): self.x = 0 self.y = 0p = Point()p.reset()print(p.x, p.y)
转载地址:http://mnwzo.baihongyu.com/