关于@staticmethod 静态方法
来源:9-11 静态方法

Jackchenxiaoliang
2018-03-29
我想请问下,在以下代码:
@staticmethod
def add(x,y)
print('This is a staticmethod')
这里的x,y是干什么用的?似乎并没有用到?
写回答
1回答
-
是形式参数,调用这个方法时需要传入代表x,y的值,但是在方法中可以不使用这两个变量
242018-03-30
相似问题
关于@staticmethod 静态方法
来源:9-11 静态方法
Jackchenxiaoliang
2018-03-29
我想请问下,在以下代码:
@staticmethod
def add(x,y)
print('This is a staticmethod')
这里的x,y是干什么用的?似乎并没有用到?
1回答
是形式参数,调用这个方法时需要传入代表x,y的值,但是在方法中可以不使用这两个变量
相似问题