0 points

How to add another item at the end of the list


dashboard

Tue Apr 21 2020 06:29:54 GMT+0000 (UTC)

Posted by @BubbleSummary #python #python #lists #add

# animals list
1.animals = ['cat', 'dog', 'rabbit']

# list of wild animals
2.wild_animals = ['tiger', 'fox']

# appending wild_animals list to the animals list
3.animals.append(wild_animals)

4.print('Updated animals list: ', animals)                                
                                
content_copy Copy

This code is used to add another item at the end of the list.

https://www.programiz.com/python-programming/methods/list/append