Page 172 -
P. 172
data in files and arrays
These are some of the methods that come built into every array. See
if you can match up the descriptions with the method names. Draw in
the missing connecting lines. We’ve done one for you to get you started:
Method What the method does
count() Sorts the array into a specified order (low to high)
extend() Removes and returns the last array item
index() Adds an item at any index location
insert() Looks for an item and returns its index value
pop() Reverses the order of the array
remove() Tells you how many times a value is in the array
reverse() Adds a list of items to an array
sort() Removes and returns the first array item
Can you work out which two methods you need to employ to allow
you to sort the data in the order that you need?
you are here 4 137