exam 2 voacb ch 7 - 11 Flashcards

1
Q

A variable used to count something. It’s usually initialized to zero and then incremented

A

Counter¶

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

A string with no characters and length 0, represented by two quotation marks.

A

Empty String

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

An operator, %, that takes a format string and a tuple and generates a string that includes the elements of the tuple formatted as specified by the format string.

A

Format Operator

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

A sequence of characters in a format string, like %d, that specifies how a value should be formatted.

A

Format Sequence

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

A string, used with the format operator, that contains format sequences

A

Format String

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

A boolean variable used to indicate whether a condition is true or false.

A

Flag

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

A statement that calls a method.

A

Invocation

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

A property of sequences whose items cannot be reassigned.

A

Immutable

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

An integer value used to select a character in a string

A

String Index

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

One of the values in a sequence

A

Item

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

A function that is associated with an object and called using dot notation

A

Method

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

A string that a variable can refer to. For now, you can use “object” and “value” interchangeably.

A

String Object

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

A pattern of traversal that stops when it finds what it is looking for.

A

Search

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

An ordered set; that is, a set of values where each value is identified by an integer index

A

Sequence

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

A part of a string specified by a range of indicies

A

Slice

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

To iterate through the items in a sequence, performing a similar operation on each

A

Transverse

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

Opens the file named filename for reading and returns a file object

A

file_obj = open(filename)

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

Closes an open file (most crucial when writing to a file)

A

file_obj.close()

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

Reads all data from a file object and returns it as a string

A

file_obj.read()

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

Returns a line from a file object as a string

A

file_obj.readline()

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

Returns a list of lines from a file object

A

file_obj.readlines()

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

Writes the line to the file object

A

file_obj.write(line)

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

Change directory - takes you to the root directory

A

cd

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

Will change the current directory to the specified directory

A

cd dir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Change directory up one level (move to the parent directory)
cd..
26
Print working directory or show the current directory
pwd
27
List the contents of the current directory
ls
28
Download a copy of the repo at the given URL to the current directory
git clone URL
29
Add the specified file to the list of files to be committed
git add file
30
What files have been added and/or changed
git status
31
Package changes into a commit on your local computer
git commit -m “message”
32
Push commits to your GitHub account
git push
33
Download changes from GitHub to your local repo
git pull
34
To prevent an exception from terminating a program using the try and except statements.
Catch
35
A special character, ‘n’, used in files and strings to indicate the end of a line.
Newline
36
Object that knows how to read from or write to a file.
File Object or File Handle Object
37
A technique that works elegantly in Python. “Using try and except is the _______ way to recover from missing files”
Pythonic
38
A person or team focused on insuring the overall quality of a software product. QA is often involved in testing a product and identifying problems before the product is released.
Quality Assurance
39
A sequence of characters stored in permanent storage like a hard drive
Text File
40
A circumstance where two or more variables refer to the same object
Aliasing
41
A character or string used to indicate where a string should be spli
Delimiter
42
One of the values in a list (or other sequence); also called items
Element
43
Having the same value
Equivalent
44
An integer value that indicates an element in a list
Index
45
Being the same object (which implies equivalence)
Identical
46
A sequence of values
List
47
The sequential accessing of each element in a list
List Transversal
48
A list that is an element of another list
Nested
49
Something a variable can refer to. An object has a type and a value
Object
50
The association between a variable and its value
Reference
51
A mapping from a set of keys to their corresponding values
Dictionary
52
The algorithm used to implement Python dictionaries
hashtable
53
A function used by a hashtable to compute the location for a key
hash functions
54
A set of counters
Histogram
55
A way of performing a computation
Implementation
56
Another name for a key-value pair
Dictionary Item
57
An object that appears in a dictionary as the first part of a key-value pair
Key
58
The representation of the mapping from a key to a value
Key-Value Pair
59
A dictionary operation that takes a key and finds the corresponding value
Lookup
60
When there are one or more loops “inside” of another loop. The inner loop runs to completion each time the outer loop runs once
Nested Loops
61
An object that appears in a dictionary as the second part of a key-value pair. This is more specific than our previous use of the word “value”
Dictionary value
62
A quality of certain types where one value can be checked to see if it is greater than, less than, or equal to another value of the same type. Types which are comparable can be put in a list and sorted.
Comparable
63
A collection of related values, often organized in lists, dictionaries, tuples, etc
Data Structure
64
Abbreviation of “decorate-sort-undecorate”, a pattern that involves building a list of tuples, sorting, and extracting part of the result
DSU
65
The operation of assembling a variable-length argument tuple
Gather
66
A type that has a hash function. Immutable types like integers, floats, and strings are hashable; mutable types like lists and dictionaries are not
hashable
67
A summary of the type, size, and composition of a data structure
Shape (of a data structure)
68
A list (or other sequence) with a single element
Singleton
69
An immutable sequence of elements
Tuple
70
An assignment with a sequence on the right side and a tuple of variables on the left. The right side is evaluated and then its elements are assigned to the variables on the left
Tuple Assignment