append
only works on variables, not list literals, since it updates the list object itself and does not return the resulting list.
As @Tomalak mentioned noted, running a similar operation on a simple list also returns None
>>> [1, 2, 3].append(4) == None
True
More Related Contents:
- how to create a list of lists using list comprehension [closed]
- How to create the following lists with list comprehensions? [closed]
- Accessing class variables from a list comprehension in the class definition
- Why is a list comprehension so much faster than appending to a list?
- List comprehension and lambdas in Python [duplicate]
- Add an element in each dictionary of a list (list comprehension)
- Are list comprehensions syntactic sugar for `list(generator expression)` in Python 3?
- eval fails in list comprehension [duplicate]
- List comprehension scope error from Python debugger
- Skip elements on a condition based in a list comprehension in python
- How do I create a list of lambdas (in a list comprehension/for loop)?
- Calling a python script with input within a python script using subprocess
- certificate verify failed: unable to get local issuer certificate
- Weird behavior: Lambda inside list comprehension [duplicate]
- How do I resolve a TesseractNotFoundError?
- Why do I get an int when I index bytes?
- How does one ignore extra arguments passed to a dataclass?
- Python 3.3 and Installing PyOpenSSL on a Mac
- How to install pyaudio on mac using Python 3?
- Why won’t this ctypes code work with Python 3.3 but will work with Python 2.7?
- Specify format of floats for tick labels
- Error “Import Error: No module named numpy” on Windows
- How to apply a function to each sublist of a list in python?
- What is the use of stub files (.pyi ) in python?
- How to reuse an expression in a comprehension expression?
- How to move the background image with keys in pygame?
- How to limit the size of a comprehension?
- Is there a way to use asyncio.Queue in multiple threads?
- Add custom form fields that are not part of the model (Django)
- Writing to a new file if it doesn’t exist, and appending to a file if it does