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
Q

Change directory up one level (move to the parent directory)

A

cd..

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

Print working directory or show the current directory

A

pwd

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

List the contents of the current directory

A

ls

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

Download a copy of the repo at the given URL to the current directory

A

git clone URL

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

Add the specified file to the list of files to be committed

A

git add file

30
Q

What files have been added and/or changed

A

git status

31
Q

Package changes into a commit on your local computer

A

git commit -m “message”

32
Q

Push commits to your GitHub account

A

git push

33
Q

Download changes from GitHub to your local repo

A

git pull

34
Q

To prevent an exception from terminating a program using the try and except statements.

A

Catch

35
Q

A special character, ‘n’, used in files and strings to indicate the end of a line.

A

Newline

36
Q

Object that knows how to read from or write to a file.

A

File Object or File Handle Object

37
Q

A technique that works elegantly in Python. “Using try and except is the _______ way to recover from missing files”

A

Pythonic

38
Q

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.

A

Quality Assurance

39
Q

A sequence of characters stored in permanent storage like a hard drive

A

Text File

40
Q

A circumstance where two or more variables refer to the same object

A

Aliasing

41
Q

A character or string used to indicate where a string should be spli

A

Delimiter

42
Q

One of the values in a list (or other sequence); also called items

A

Element

43
Q

Having the same value

A

Equivalent

44
Q

An integer value that indicates an element in a list

A

Index

45
Q

Being the same object (which implies equivalence)

A

Identical

46
Q

A sequence of values

A

List

47
Q

The sequential accessing of each element in a list

A

List Transversal

48
Q

A list that is an element of another list

A

Nested

49
Q

Something a variable can refer to. An object has a type and a value

A

Object

50
Q

The association between a variable and its value

A

Reference

51
Q

A mapping from a set of keys to their corresponding values

A

Dictionary

52
Q

The algorithm used to implement Python dictionaries

A

hashtable

53
Q

A function used by a hashtable to compute the location for a key

A

hash functions

54
Q

A set of counters

A

Histogram

55
Q

A way of performing a computation

A

Implementation

56
Q

Another name for a key-value pair

A

Dictionary Item

57
Q

An object that appears in a dictionary as the first part of a key-value pair

A

Key

58
Q

The representation of the mapping from a key to a value

A

Key-Value Pair

59
Q

A dictionary operation that takes a key and finds the corresponding value

A

Lookup

60
Q

When there are one or more loops “inside” of another loop. The inner loop runs to completion each time the outer loop runs once

A

Nested Loops

61
Q

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”

A

Dictionary value

62
Q

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.

A

Comparable

63
Q

A collection of related values, often organized in lists, dictionaries, tuples, etc

A

Data Structure

64
Q

Abbreviation of “decorate-sort-undecorate”, a pattern that involves building a list of tuples, sorting, and extracting part of the result

A

DSU

65
Q

The operation of assembling a variable-length argument tuple

A

Gather

66
Q

A type that has a hash function. Immutable types like integers, floats, and strings are hashable; mutable types like lists and dictionaries are not

A

hashable

67
Q

A summary of the type, size, and composition of a data structure

A

Shape (of a data structure)

68
Q

A list (or other sequence) with a single element

A

Singleton

69
Q

An immutable sequence of elements

A

Tuple

70
Q

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

A

Tuple Assignment