PY3.R1736
Unnecessary list index lookup
Emitted when iterating over an enumeration and accessing the value by index lookup. The value can be accessed directly instead.
Noncompliant Code:
Copy
letters = ['a', 'b', 'c']
for index, letter in enumerate(letters):
print(letters[index])
Compliant Code:
Copy
letters = ['a', 'b', 'c']
for index, letter in enumerate(letters):
print(letter)