Chapter 11 Flashcards

1
Q

if a=[1, 2, 3] and b=[1,2,3] do and b point to the same object?

A

no

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

if a=[1,2,3] and b=a, do b and a point to the same object?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

aliases

A

Multiple variables that contain references to the same object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

clone

A

To create a new object that has the same value as an existing object. Copying a reference to an object creates an alias but doesn’t clone the object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

delimeter

A

A character or string used to indicate where a string should be split.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

element

A

One of the values in a list (or other sequence). The bracket operator selects elements of a list. Also called item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

immutable data value

A

A data value which cannot be modified. Assignments to elements or slices (sub-parts) of immutable values cause a runtime error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

index

A

An integer value that indicates the position of an item in a list. Indexes start from 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

item

A

See element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

list

A

A collection of values, each in a fixed position within the list. Like other types str, int, float, etc. there is also a list type-converter function that tries to turn whatever argument you give it into a list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

list traversal

A

The sequential accessing of each element in a list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

modifier

A

A function which changes its arguments inside the function body. Only mutable types can be changed by modifiers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

mutable data value

A

A data value which can be modified. The types of all mutable values are compound types. Lists and dictionaries are mutable; strings and tuples are not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

nested list

A

A list that is an element of another list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

object

A

A thing to which a variable can refer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

pattern

A

A sequence of statements, or a style of coding something that has general applicability in a number of different situations. Part of becoming a mature Computer Scientist is to learn and establish the patterns and algorithms that form your toolkit. Patterns often correspond to your “mental chunking”.

17
Q

promise

A

An object that promises to do some work or deliver some values if they’re eventually needed, but it lazily puts off doing the work immediately. Calling range produces a promise.

18
Q

pure function

A

A function which has no side effects. Pure functions only make changes to the calling program through their return values.

19
Q

sequence

A

Any of the data types that consist of an ordered collection of elements, with each element identified by an index.

20
Q

side effect

A

A change in the state of a program made by calling a function. Side effects can only be produced by modifiers.

21
Q

step size

A

The interval between successive elements of a linear sequence. The third (and optional argument) to the range function is called the step size. If not specified, it defaults to 1.