You are viewing a single comment's thread. Return to all comments →
you can make your code more readable if you stack the if statement like this
for j in range(1,n-1): if (a[i][j] > a[i+1][j] and a[i][j] > a[i-1][j] and a[i][j] > a[i][j+1] and a[i][j] > a[i][j-1]): a[i][j]="X"
I also fixed the error in the code. the for loop in your code had j+1 for both the first and second check.
Seems like cookies are disabled on this browser, please enable them to open this website
Cavity Map
You are viewing a single comment's thread. Return to all comments →
you can make your code more readable if you stack the if statement like this
I also fixed the error in the code. the for loop in your code had j+1 for both the first and second check.