Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 464 Bytes

File metadata and controls

32 lines (21 loc) · 464 Bytes

AttributeError: 'dict' object has no attribute 'append'

Occurs when calling append() on a dictionary.

Reproduce

user_scores = {"math": 90}

print(user_scores)
user_scores.append(85)

Error Message

AttributeError: 'dict' object has no attribute 'append'

Fix

user_scores = {"math": 90}

print(user_scores)
user_scores["english"] = 85
print(user_scores)

Reflection

Tried using append() on a dict like a list.