python类 如何编写 class name: a = xxxxxx b = xxxxxx c = xxxxxx @classmethod def name(): xxxxxx xxxxxx return xxxxxx sa = xxxxxx sb = xxxxxx sc = xxxxxx 如何运用 class c: @classmethod def a(self,num): num = num * num - 1 c.a(9) 输出: 80 @classmethod 如果不用这段看似没用的代码,就有一个traceback. @classmethod