Python List object attribute ‘append’ is read-only

To append something to a list, you need to call the append method:

passwords.append(Choice13)

As you’ve seen, assigning to the append method results in an exception as you shouldn’t be replacing methods on builtin objects — (If you want to modify a builtin type, the supported way to do that is via subclassing).

Leave a Comment