Closed eskiyerli closed 1 week ago
@eskiyerli, thank you for the question! there is no need to use them, the i
and j
for-loop variables are used here just to limit the loop run to a specific number of iterations, nothing more. Still as you can see there was an attempt to tune this (for(i=1; i<=nx; i++) {
lines are commented)
Hello @eskiyerli, does it answer your question?
Interesting way of doing loops but this indeed answers my question.
The Pythonic way to handle unused indices is to use an underscore (_):
for _ in range(int(nx)) :
for _ in range(int(ny)) :
In this code, there are for loops for
i
andj
variables, but there is nothing in the loops that refer to these variables.