How to Add an Element to an Array in Python


In this example we will show how to add an element to an array in Python.

Source Code

letter = ['a', 'b', 'c', 'd']
print(letter)
letter.append('e')
print(letter)

Output:

['a', 'b', 'c', 'd']
['a', 'b', 'c', 'd', 'e']
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments