Appending Items To Lists

Description

We can append items to the end of a list and extend the list as much as we want. This is done using the .append() method.

Sage Cell

Code

A = [ 2, 3, 5, 7, 11 ]
A.append(13)
print(A)

Options

none

Tags

Primary Tags—Programming: Python

Secondary Tags—Python: Lists

Related Cells

Attribute

Permalink:

Author:

Date: 25 Mar 2019 14:57

Submitted by: Zane Corbiere

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License