MCPcopy
hub / github.com/jwasham/practice-python / array_test

Function array_test

arrays/array.py:4–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4def array_test():
5 ar = [3, 2, 4, 5]
6
7 ar.pop()
8
9 ar.append(6)
10
11 print(ar)
12 print("Index of 4: ", ar.index(4)) # index of given value
13
14 ar.remove(4) # remove the first occurence of item with given value
15 print("Removed 4: ", ar)
16
17 ar.reverse()
18 print("reversed: ", ar)
19 print("sorted return: ", sorted(ar))
20
21 ar.sort()
22 print("sorted in place: ", ar)
23
24
25def main():

Callers 1

mainFunction · 0.85

Calls 3

popMethod · 0.80
appendMethod · 0.80
sortMethod · 0.45

Tested by

no test coverage detected