【python进阶】模拟数值类型

from math import hypot class Vector: def __init__(self, x=0, y=0): self.x = x self.y = y def __repr__(self): #定义输出表示方法 return 'Vector(%r, %r)' % (self.x, self.y)
相关文章
相关标签/搜索