gpt4 book ai didi

python - 忽略 Python 中的异常

转载 作者:太空宇宙 更新时间:2023-11-03 12:11:55 25 4
gpt4 key购买 nike

<分区>

我在 python 中有 try-except block ,发生异常时我不想做任何事情。我的代码如下:

for i in range(len(grid)):
for j in range(len(grid[i])):
try:
count = count > int(grid[i][j]) ? count : int(grid[i][j])
except:
//Do nothing here

捕获到异常时如何不做任何事情。

谢谢。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com