While working with list, there is a consistent need of modifying it, particularly adding new elements to it.
So this recipe is a short example on how to append a list in python. Let's get started.
def list_append(x): return [x*2,x*3],x*4,x*5
We have created a simple function that returns multiples of values passed in it.
Take any example of a list. In 2nd line of code, we call append function and it call's our predefined function to receive values.
Firstly, list_append function bring in a multiple of 11 in appended braces. Thereby the append function receives inputs and simply reflect onto the table list.
Simply use print function to print the newly appended list.
Once we run the above code snippet, we will see:
[11, ([22, 33], 44, 55)]