list.update function

Update a list by appending or modifying its elements.