Array 3 Flashcards
You can access any array item by using its ______.
Index
Syntax for accessing array elements
arrayName[indexNum]
The array index starts with _. You can also access the last
element of an array using the _
index
0, -1
_________is to insert one or more data elements into an array. Based on the requirement, a new element can be
added at the beginning, end, or any given index of array.
Insertion operation
In insertion operation, we add a data element at the middle of the
array using the python in-built ______method.
insert()
Syntax in insertion operation
array.insert(index, element)
_______refers to removing an existing element from the array and re-organizing all elements of an array.
Deletion Operation
In deletion operation we remove a data element at the middle of
the array using the python in-built ______
method.
remove()
Syntax in deletion operation
array.remove(element)
You can perform a search for an array element based on its
value or its index.
Search operation
In search operation, we search a data element using the python in-built _____ method.
index()
When we compile and execute with search operation, it produces the following result which shows the _____ of the element.
index
If the value is not present in the array then the program returns an _____.
error
Syntax for Search operation
array.index(element)
_______refers to updating an existing element from the array at a given index.
Update operation