Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore exception in Python [duplicate]

I have try-except block in python, and I want to do nothing when exception occurs. My code is as follows:

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

How do I do nothing when exception is caught.

Thanks.

like image 711
hrishikeshp19 Avatar asked Feb 11 '12 20:02

hrishikeshp19


1 Answers

pass is the keyword you are looking for.

like image 200
snim2 Avatar answered Oct 06 '22 00:10

snim2