Open anniezhi opened 1 year ago
Hi Xiaoying, I don't see the bug you are referring too. The variable i
is not used after the for
loop line 167, so how could it cause a bug?
Hi Lucas, Thanks for getting back. Variable 'i' is still used in the for loop started at line 127, after exiting the for loop in line 167. The for loop at line 167 is nested within the for loop at line 127.
I see. Index variables with the same name in nested loops do not cause problems anymore :) In that case the current code works perfectly.
Hi, I think line 127 and line 167 both use 'i' as the enumerating index, but they form a nested loop. This can cause incorrect index referencing once 'done' is not full of 'False'.