def __str__(self):
if self.p < self.q:
k = self.p
else:
k = self.q
for x in range(k, 0, -1):
if self.p%x==0 and self.q%x == 0:
self.p = self.p / x
self.q = self.q / x
break
return '%s/%s' % (self.p, self.q)
产品经理不是经理
相关分类