2009-05-29から1日間の記事一覧

Pythonの__str__と__repr__

コメントもらったので試してみた。point.py """Point class This is the Point class """ class Point: __x = 0.0 __y = 0.0 z = 0.0 def __init__(self, x1, y1, z1) : self.__x = x1 self.__y = y1 self.z = z1 def toString(self) : return '(' + str(sel…