Array Flashcards
What is an Array?
An array is a special variable, which can hold more than one value at a time.
Access the Elements of an Array?
You refer to an array element by referring to the index number.
Get the value of the first array item:
x = cars[0]
Modify the value of the first array item:
cars[0] = “Toyota”
Adds an element at the end of the list
append()
Removes all the elements from the list
clear()
Returns a copy of the list
copy()
Returns the number of elements with the specified value
count()
Add the elements of a list (or any iterable), to the end of the current list
extend()
Returns the index of the first element with the specified value
index()
Adds an element at the specified position
insert()
Removes the element at the specified position
pop()
Removes the first item with the specified value
remove()
Reverses the order of the list
reverse()
Sorts the list
sort()