for range(stop), the last element is the largest 'i' less than stop 

The last column is not included in the array if you deduct one from the parameter to range(). It does not really affect the check here, but might be a cause for confusion if you decide to extend the check.

Source: https://docs.python.org/2/library/functions.html#range