import re
class work:
def a(self, i):
i = 10
j = 12
self.i = i
self.match(i)
self.j = j
self.match(j)
def match(self, a, b):
print("this is I", a)
print("this is J", b)
x = work()
x.a(0)
self.match(i)
TypeError: match() missing 1 required positional argument: 'b'
尝试导入i
和j
进行匹配!任何帮助
答案 0 :(得分:1)
您在函数定义中给出了两个参数:
def match(self, a, b):
print("this is I", a)
print("this is J", b)
,但只打了一个电话:
self.match(j)