实在搞不懂,明明传了参数为什么报没有参数?
class Person(object):
def test(a):
print a
xiaoming = Person()
xiaohong = Person()
print xiaoming.test('xiaoming')
print xiaohong.test('xiaohong')
print xiaoming == xiaohong
运行失败
Traceback (most recent call last):
File "index.py", line 8, in
print xiaoming.test('xiaoming')
TypeError: test() takes exactly 1 argument (2 given)