Python List object attribute append is read-only

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 youve seen, assigning to the append method results in an exception as you shouldnt be replacing methods on builtin objects — (If you want to modify a builtin type, the supported way to do that is via subclassing).

or you could modify the same list slot by doing:

passwords[passwords.index(mrjoeadmin)] = Choice13

Python List object attribute append is read-only

Leave a Reply

Your email address will not be published. Required fields are marked *