list is mutable
Change
last_list=last_list.append(p.last_name)
to
last_list.append(p.last_name)
will work
More Related Contents:
- convert string to list [duplicate]
- Unable to use convert strings into integers for a for loop
- Strange result when removing item from a list while iterating over it
- How to merge lists into a list of tuples?
- Pythonic way to print list items
- Pythonic way to check if a list is sorted or not
- Detecting consecutive integers in a list [duplicate]
- Non-alphanumeric list order from os.listdir()
- How do I check if there are duplicates in a flat list?
- Python – use list as function parameters
- Memory errors and list limits?
- Sum of list of lists; returns sum list
- List of tuples to dictionary [duplicate]
- [] and {} vs list() and dict(), which is better?
- How to split strings inside a list by whitespace characters
- Complexity of list.index(x) in Python
- How to transform string of space-separated key,value pairs of unique words into a dict
- Nested list comprehensions
- Python range() and zip() object type
- How do I merge multiple lists into one list? [duplicate]
- How can I format a list to print each element on a separate line in python? [duplicate]
- Group list by values [duplicate]
- Python: filtering lists by indices
- What are dict_keys, dict_items and dict_values?
- Ordered intersection of two lists in Python
- What to consider before subclassing list?
- Retrieve the two highest item from a list containing 100,000 integers
- How does str.startswith really work?
- Best way to remove elements from a list
- All possible permutations of a set of lists in Python