appending list but error ‘NoneType’ object has no attribute ‘append’ [duplicate]

list is mutable

Change

last_list=last_list.append(p.last_name)

to

last_list.append(p.last_name)

will work

Leave a Comment