title: python format error saying index out of range when it isnt
body: <p>I seem to be having an issue pythons .format() tool. I currently have this code:</p>
  <pre><code>varno=6
  input=product([True,False],repeat = (varno))
  string= ({1} or not {2} or not {5} )and (not {1} or {6} )and (not {2} or not {3} )and ({3} or not {4} )and (not {4} or {5} or not {6} )
  for i in input:
     print(i)  //prints (True, True, True, True, True, True)
     ans=(string.format(*i))
  </code></pre>
  <p>and It returns this error</p>
  <pre><code>    ans=(string.format(*i))
  IndexError: Replacement index 6 out of range for positional args tuple
  </code></pre>
  <p>even though there are 6 values in i, so 6 should not be out of range. I have no idea what is going wrong or how to fix it. Any help would be greatly appreciated.</p>