ANSWERS COMPLETE STUDY GUIDE EXAM
PREP PRACTICE TEST
| GRADED A+ | GUARANTEED SUCCESS
UPDATED QUESTIONS AND ANSWERS
100% VERIFIED EXAM PREP
[EXAM• STUDY GUIDE • SUMMARY • ASSIGNMENT]
A clean, organized resource designed for easy revision and reference.
QUICK • CLEAR • PROFESSIONAL
,range() generates a sequence of numbers, starting at zero and ending before a value given
inside the parentheses. For example, for i in range(3) sets i to 0 during the first iteration of
the for loop, i to 1 during the second iteration, and finally i to 2 on the third iteration. The
value within the parentheses is not included in the generated sequence.
namespace A ____________ maps names to objects. The Python interpreter uses namespaces to track all
of the objects in a program.
object In a program, an ______ consists of some internal data items plus operations that can be
performed on that data.
Value: A ________ such as "20", "abcdef", or 55.
min(list) Find the element in list with the smallest value.
sum(list) Find the sum of all elements of a list (numbers only).
list.index(val) find the index of the first element in list whose value matches val.
list.count(val) Count the number of occurrences of the value val in list.
max(list) Find the element in list with the largest value.
name A ,__________ also called an identifier, is a sequence of letters (a-z, A-Z, _) and digits (0-9),
and must start with a letter. Note that "_", called an underscore, is considered to be a
letter.
type() built-in function ___________ prints the type of an object.
, Identity: A unique identifier that describes the object
selection sort O(n^2) A sort algorithm that repeatedly searches remaining items to find the least one
and moves it to its final location.
Remove(list, x) Removes x Remove(list, 77), list: 99
Search(list, x) Returns item if found, else returns null Search(list, 99), returns item 99Search(list, 22),
returns null
Print(list) Prints list's items in orderPrint(list) outputs: 99, 77
Sort(list) Sorts the lists items in ascending orderlist becomes: 77, 99
IsEmpty(list) Returns true if list has no items
For list 99, 77, IsEmpty(list) returns false
GetLength(list) Returns the number of items in the listGetLength(list) returns 2
record data structure that stores subitems, with a name associated with each subitem
array a data structure that stores an ordered list of items, with each item is directly accessible
by a positional index
homogeneous data elements Inserting at the beginning requires making room for the
new item. So every current item must be shifted once.
linked list data structure that stores ordered list of items in nodes, where each node stores data
and has a pointer to the next node; can have multiple subitems No shifting of other items
is required, which is an advantage of using linked lists.
binary tree A data structure that consists of nodes, with one root node at the base of the tree, and
two nodes (left child and right child) extending from the root, and from each child node
can have no children, single left or right, or both right and left