Does range() not evaluate its argument every time?

前端 未结 3 866
我寻月下人不归
我寻月下人不归 2021-01-15 11:22

l is passed as an argument to range function whose value is modified inside for loop, but the loop is going for 10 times

3条回答
  •  梦谈多话
    2021-01-15 12:05

    range(l) is evaluated once, what is being updated is the value of l in the print statement.

提交回复
热议问题