Trying to access a list or a tuple index that is beyond the size of the list/tuple will result in an IndexError
and is probably a
mistake.
Noncompliant Code Example
def noncompliant():
ls = [1, 2, 3]
foo(ls[3]) # Noncompliant
Compliant Solution
def compliant():
ls = [1, 2, 3]
foo(ls[2])