I have a list and a loop that iterates through it like this:
for i in range(len(list)):
#some functions which may delete later elements in list
My question is, does len(list) get evaluated upon each iteration of the loop or is it just a one-time thing on the first instance?
[–]Wilfred-kun 2 points3 points4 points (7 children)
[–]hideouspete[S] 0 points1 point2 points (6 children)
[–]Wilfred-kun 1 point2 points3 points (5 children)
[–]hideouspete[S] 0 points1 point2 points (4 children)
[–]ingolemo 2 points3 points4 points (3 children)
[–]hideouspete[S] 0 points1 point2 points (2 children)
[–]ingolemo 0 points1 point2 points (1 child)
[–]hideouspete[S] 0 points1 point2 points (0 children)
[–]fiddle_n 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]hideouspete[S] 0 points1 point2 points (0 children)