【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)
相關文章
相關標籤/搜索