在python中检测函数错误,具体方法如下:
x = 0lis_y = [i for i in range(64,90)]def test(x,y):print (x+y)def test1(x,y):print( x*y)try:while x < 20:for y in lis_y:test(x,y)test1(x,chr(y))x+=1except:print ('Error')
x = 0
lis_y = [i for i in range(64,90)]
def test(x,y):
print (x+y)
def test1(x,y):
print( x*y)
try:
while x < 20:
for y in lis_y:
test(x,y)
test1(x,chr(y))
x+=1
except:
print ('Error')