What is the use of iter in python?
问题 What is the use of using the iter function in python? Instead of doing: for i in range(8): print i I could also use iter : for iter in range(8): print iter 回答1: First of all: iter() normally is a function. Your code masks the function by using a local variable with the same name. You can do this with any built-in Python object. In other words, you are not using the iter() function here. You are using a for loop variable that happens to use the same name. You could have called it dict and it