Adding Values to List: append() and
insert()
• Notice that the code is cat.append(‘hairy’) and cat.insert(1,
‘mice’), not cat = cat.append(‘hairy’) and cat = cat.insert(1,
‘mice’).
• Neither append() nor insert() method gives the value of cat
as its return value. In fact their return value is None. Rather
the list is modified in place.
• Methods belong to a single data type. The append() and
insert() methods are list methods and can be only called on
list values, not on other values such as integers or strings.
26