.. _potential-index-error:

potential-index-error / E0643
=============================

**Message emitted:**

Invalid index for iterable length

**Description:**

*Emitted when an index used on an iterable goes beyond the length of that iterable.*

**Problematic code:**

.. literalinclude:: /data/messages/p/potential-index-error/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/p/potential-index-error/good.py
   :language: python



Created by the `variables <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/variables.py>`__ checker.