如题,求教为什么is_valid不带self,而permeter要带self?
class Triangle(object):
def __init__(self, a, b, c):
self._a = a
self._b = b
self._c = c
@staticmethod
def is_valid(a, b, c):
return a + b > c and b + c > a and a + c > b
def perimeter(self):
return self._a + self._b + self._c
呼啦一阵风
杨__羊羊
猛跑小猪