comparison python/moving.py @ 675:ab3fdff42624

corrected old format for Point.__str__
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 26 May 2015 23:55:22 +0200
parents 01b89182891a
children da1352b89d02
comparison
equal deleted inserted replaced
674:01b89182891a 675:ab3fdff42624
166 def __init__(self, x, y): 166 def __init__(self, x, y):
167 self.x = x 167 self.x = x
168 self.y = y 168 self.y = y
169 169
170 def __str__(self): 170 def __str__(self):
171 return '(%f,%f)'%(self.x,self.y) 171 return '({:f},{:f})'.format(self.x,self.y)
172 172
173 def __repr__(self): 173 def __repr__(self):
174 return self.__str__() 174 return self.__str__()
175 175
176 def __add__(self, other): 176 def __add__(self, other):