溫馨提示×

python怎么檢測函數(shù)錯誤

九三
261
2021-02-23 14:29:27
欄目: 編程語言

python怎么檢測函數(shù)錯誤

在python中檢測函數(shù)錯誤,具體方法如下:

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')

0