Lists
Tuples
Dictionaries
Sets
General Vocabulary
100
.append()
What is the name of the function that adds an item to a list?
100
Immutable
What is a data type that cannot be changed after it has been created?
100
Mutable
How do you describe a data set that can be changed in place?
100
.clear()
What is the method that removes all of the elements from the set?
100
Argument
What is a variable passed to a function?
200
Changing the second object will change the first one.
What happens when assigning mutable objects to another one (as in, what's the issue if you assign an object to another one)?
200
Yes
Is this valid: (1,2,3)+(4,5)?
200
Unordered collection consisting of a key-value pair.
What is the definition of a dictionary?
200
.discard()
What is the set method for removing an element, and does not generate an error if the element doesn't exist in the set?
200
global
What is the keyword used to change or create global variables in a local namespace?
300
Reverses a list
What does this do: L[::-1]?
300
(1,)
How do you create a single item tuple?
300
Tuples, ints, strings (anything immutable)
What are the data types that can be used for a dictionary key?
300
subset
What do you call it when every element of one set is an element of another set?
300
Definition
What do you call the code that creates a function?
400
If you append a list, it appends it as an entire list item within the current list. If you extend a list, it'll add the elements of the list to the list object.
What is the difference between .extend and .append?
400
enumerate: for index, value in enumerate(L1):
What is the keyword that generates both the index and the item?
400
With .items(), .keys(), and .values()
What are the three different ways to iterate through a dictionary?
400
symmetric difference
What method creates a new set of values that are different from each set?
400
Default Values
What provides a way of specifying what values a parameter should be, and makes some parameters optional?
500
.sort() sorts a list in place, and returns None. sorted() returns a sorted list, but doesn't change the original list.
What is the difference between sort() and sorted.
500
Commas
What defines a tuple?
500
zip()
What is the dictionary method that combines two collections into one dictionary?
500
difference
What is the set method that returns the only unique elements of the first set?
500
Abstraction
What do you call it when you hide the unimportant details of a function from the user?