list is mutable

Change

last_list=last_list.append(p.last_name)

to

last_list.append(p.last_name)

will work

Answer from jessiejcjsjz on Stack Overflow
🌐
Reddit
reddit.com › r/learnpython › attributeerror: 'nonetype' object has no attribute 'append'
r/learnpython on Reddit: AttributeError: 'NoneType' object has no attribute 'append'
May 10, 2023 -

Hi all.

Why does my code append chicken and beef to the finished_sandwiches list, but I get the error message for the peperoni?

Thanks in advance.

sandwich_orders = ['chicken', 'beef', 'peperoni', 'ham',  'cheese & tomato']
finished_sandwiches = []

for sandwich in sandwich_orders:
    print(f"I made your {sandwich} sandwich")
    finished_sandwiches = finished_sandwiches.append(sandwich)

print("=================")
for sandwich in finished_sandwiches:
    print(finished_sandwiches)

Output:

I made your chicken sandwich
I made your beef sandwich
Traceback (most recent call last):
  File "/home/piehead/Documents/Python/crash course/exercises/7_8.py", line 6, in <module>
    finished_sandwiches = finished_sandwiches.append(sandwich)
AttributeError: 'NoneType' object has no attribute 'append'
Discussions

'NoneType' object has no attribute 'append' - Lemma Soft Forums
The error is not in such code, but the chat.addmessage code, that's trying to append the string to a list (or list object) that's not defined or wrongly defined. More on lemmasoft.renai.us
🌐 lemmasoft.renai.us
October 29, 2020
ConfigParser AttributeError: 'NoneType' object has no attribute 'append'
Bug report Checklist I am confident this is a bug in CPython, not a bug in a third-party project I have searched the CPython issue tracker, and am confident this bug has not been reported before A ... More on github.com
🌐 github.com
3
August 4, 2023
AttributeError("'NoneType' object has no attribute 'getChild'",)
Hello everyone, I’m currently experiencing an unexplained issue with an Edit Change Script on the Parameter PassedOnOrderID. Whenever a value is being passed on to the PassedOnOrderID Parameter the following Script is executed: # Retrieve the passed ID or order number passedOnID = ... More on forum.inductiveautomation.com
🌐 forum.inductiveautomation.com
1
0
June 3, 2025
biltins.AttributeError: 'Nonetype' object has no attribute 'append' - Kite Connect developer forum
Respected Sir, https://dpaste.org/5gwx this code is my macd crossover strategy get error after place buy order this error showing More on kite.trade
🌐 kite.trade
🌐
AskPython
askpython.com › home › python list: nonetype object has no append attribute in for loop
Python List: NoneType Object has No append Attribute in for loop - AskPython
July 29, 2023 - Let’s try to implement a try and except block so that the program does not abruptly break out, but it must finish gracefully in case of an error. We will see the use of try and except block with the help of the given example. To understand how the try and except block works in Python, read through the linked article. cars = None c1 = "Scorpio N" try: cars.append(c1) except AttributeError: print("Error: 'NoneType' object has no attribute 'append'") cars = [] cars.append(c1) print(cars)
🌐
Career Karma
careerkarma.com › blog › python › python typeerror: ‘nonetype’ object has no attribute ‘append’ solution
Python TypeError: ‘NoneType’ object has no attribute ‘append’ Solution
December 1, 2023 - ... Enter the title of the book: ... ‘NoneType’ object has no attribute ‘append’” error is returned when you use the assignment operator with the append() method....
🌐
Codecademy
codecademy.com › forum_questions › 531e9a609c4e9d26b4001b50
18/18 AttributeError: 'NoneType' object has no attribute 'append' | Codecademy
Okay, I think I get it now. ... This is the Correct answer. ... def flatten(lists): results = [ ] for numbers in lists: print numbers for i in numbers: print i results.append(i) return results print flatten(n)
🌐
Lemma Soft
lemmasoft.renai.us › forums › viewtopic.php
'NoneType' object has no attribute 'append' - Lemma Soft Forums
October 29, 2020 - The error is not in such code, but the chat.addmessage code, that's trying to append the string to a list (or list object) that's not defined or wrongly defined.
Find elsewhere
🌐
Brainly
brainly.com › computers and technology › high school › how can you fix the attributeerror: 'nonetype' object has no attribute 'append'?
[FREE] How can you fix the AttributeError: 'NoneType' object has no attribute 'append'? - brainly.com
November 19, 2023 - To fix this error, ensure the variable is a list and not None before calling append(). You can use a simple check to avoid this error. The error message 'AttributeError: NoneType object has no attribute append' usually occurs in Python when ...
🌐
Esri Community
community.esri.com › t5 › arcmap-questions › attributeerror-nonetype › td-p › 271203
AttributeError: 'NoneType' - Esri Community
May 3, 2023 - I am trying to add a feature layer to a Web Map, and when running the ".add_layer()" method I am getting an error. The error is an AttributeError: 'NoneType' object has no attribute 'append'. Eventually, I would like to be able to run a loop and add the layer to a selection of web maps.
🌐
Codecademy
codecademy.com › forum_questions › 548c2981d3292fb1960044ab
Why this 'NoneType' object has no attribute 'append' occur? | Codecademy
because you are trying to access ... an attribute, hence the error you’ll want to double check what that variable contains at the time that you try to append something to it, either you are treating the value incorrectly or ...
🌐
GitHub
github.com › python › cpython › issues › 107625
ConfigParser AttributeError: 'NoneType' object has no attribute 'append' · Issue #107625 · python/cpython
August 4, 2023 - ] conf = configparser.ConfigParser( ... 'NoneType' object has no attribute 'append' The reason is that ConfigParser assumes the second key is a continuation line and therefore further assumes that cursect[optname] is initialized ...
Author   mpf82
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-nonetype-object-has-no-attribute-append
AttributeError: 'NoneType' object has no attribute 'append' | bobbyhadz
April 8, 2024 - To solve the error, make sure to only call append() on list objects. Here is a very simple example of how the error occurs. ... Copied!my_list = None # ⛔️ AttributeError: 'NoneType' object has no attribute 'append' my_list.append('bobby...
🌐
sebhastian
sebhastian.com › attributeerror-nonetype-object-has-no-attribute-append
How to fix AttributeError: 'NoneType' object has no attribute 'append' | sebhastian
February 27, 2023 - To resolve this error, make sure you’re not calling append() from a NoneType object. Unlike the append() method in other programming languages, the method in Python actually changes the original list object without returning anything. Python implicitly returns None when a method returns nothing, so that value gets assigned to the list if you assign the append() result to a variable.
🌐
TechGeekBuzz
techgeekbuzz.com › blog › python-attributeerror-nonetype-object-has-no-attribute-appendsolution
Python AttributeError: 'NoneType' object has no attribute 'append' Solution
Functions that don't return anything has the return value 'None'. When we use the append() method on the NoneType object, we receive the error AttributeError: 'NoneType' object has no attribute 'append' .
🌐
Twitter
twitter.com › GregKamradt › status › 1841110765790691707
AttributeError: 'NoneType' object has no attribute 'append'
JavaScript is not available · We’ve detected that JavaScript is disabled in this browser. Please enable JavaScript or switch to a supported browser to continue using twitter.com. You can see a list of supported browsers in our Help Center · Help Center · Terms of Service Privacy Policy ...
🌐
Broadcom
knowledge.broadcom.com › external › article › 405343 › config-translation-failed-reason-distrib.html
Config translation failed [Reason: Distributed Firewall failed with "NoneType' object has no attribute 'append"]
July 28, 2025 - During V2T Migration, while performing "Translate L2, L4-L7 Configuration" the workflow fails immediately with below error messages Config translation failed [Reason: Distributed Firewall failed with "NoneType' object has no attribute 'append"]
🌐
Inductive Automation
forum.inductiveautomation.com › ignition
AttributeError("'NoneType' object has no attribute 'getChild'",) - Ignition - Inductive Automation Forum
June 3, 2025 - Hello everyone, I’m currently experiencing an unexplained issue with an Edit Change Script on the Parameter PassedOnOrderID. Whenever a value is being passed on to the PassedOnOrderID Parameter the following Script is executed: # Retrieve the passed ID or order number passedOnID = self.params.PassedOnOrderID system.perspective.print('passedOnID is: ' + str(passedOnID)) # Get a reference to the table component table = self.getChild("root").getChild("fc_Offline_Programmieraufträge").getChi...
🌐
Quora
quora.com › How-do-I-fix-AttributeError-NoneType-object-has-no-attribute-get-in-python
How to fix 'AttributeError: 'NoneType' object has no attribute 'get'' in python - Quora
Answer: At its most basic it means that something you think is an object with a get method (probably a dictionary) actually is simply a None object. I would check your code for every time you assign a value to that name or location in a list ...
🌐
Kite
kite.trade › forum › discussion › 7834 › biltins-attributeerror-nonetype-object-has-no-attribute-append
biltins.AttributeError: 'Nonetype' object has no attribute 'append' - Kite Connect developer forum
It's simply because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain the method you are calling.
🌐
Itsourcecode
itsourcecode.com › home › attributeerror nonetype object has no attribute append [solved]
Attributeerror nonetype object has no attribute append [Solved]
April 5, 2023 - The AttributeError: ‘NoneType’ object has no attribute ‘append’ error occurs when you try to append an item to a NoneType object.