duplicate-key / W0109#

Message emitted:

Duplicate key %r in dictionary

Description:

Used when a dictionary expression binds the same key multiple times.

Problematic code:

test_score = {"Mathematics": 85, "Biology": 90, "Mathematics": 75}  # [duplicate-key]

Correct code:

test_score = {"Mathematics": 85, "Biology": 90, "History": 75}

Related links:

Created by the basic checker.