Assigning the value returned by a function to a variable in Python
<p>I began coding in Python recently and encountered a problem assigning the value returned by a function to a variable.</p>

<pre><code>class Combolock:
    def _init_(self,num1,num2,num3):
        self.x = [num1,num2,num3]
    def next(self, state):
        print "Enter combination"
        combo = raw_input("&gt;")
        if combo == self.x[state]:
            print "Correct"
            return 1
        else:
            print "Wrong"
            return 0
    def lock(self):
        currentState = 0
        while currentState &lt; 2:
            temp = next(currentState)
            if temp == 1:
                currentState = currentState + 1
            else:
                currentState = 99
                print "ALARM"
</code></pre>

<p>When I call the lock function, I get an error at the line</p>

<pre><code>temp = next(currentState)
</code></pre>

<p>saying that an int object is not an iterator.</p>
