title: Incremental for loop in Python
body: <p>I have a hard time understanding for loops in Python.
  I have the following code in Javascript (Modolus 11 test) I want to convert to Python:</p>
  
  <pre><code>    var secNumber = this.dob + lastDigits;
      var factors = [4, 3, 2, 7, 6, 5, 4, 3, 2, 1];
  
      for (var i = 0, sum = 0; i &lt; factors.length; i++) {
        sum += secNumber.substring(i, i + 1) * factors[i];
      }
  
      // modulus 11 test
      return sum % 11 !== 0 ? false : true;
  </code></pre>
  
  <p>What would the Python equivalent be ?</p>