1/39
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
four
There are ____ collection data types in the Python programming language
List
_____ is a collection which is ordered and changeable. Allows duplicate members
Tuple
_____ is a collection which is ordered and unchangeable. Allows duplicate members
Set
____ is a collection which is unordered, unchangeable, and unindexed. No duplicate members.
Dictionary
______ is a collection which is ordered and changeable. No duplicate members
Lists
_____ are used to store multiple items in a single variable and are created using square brackets
len()
To determine how many items a list has, use the ____ function
end
Negative indexing means start from the ____
append()
To add an item to the end of the list, use the ______ method
insert()
To insert a new list item, without replacing any of the existing values, you can use the _____ method
extend()
To append elements from another list to the current list, use the ____ method
remove()
The _____ method removes the specified item
pop()
The _____ method removes the specified index
last
If you do not specify the index, the pop() method removes the ____ item
del
____ keyword also removes the specified index
del
The ___ keyword can delete the list completely
clear()
The _____ method empties the list
Tuples
_____ are used to store multiple items in a single variable and are written with parenthesis
comma
To create a tuple with only one item, you have to add a _____ after the item, otherwise Python will not recognize it as a tuple
immutable
Tuples are unchangeable, or ______ as it also is called
Sets
_____ are used to store multiple items in a single variable and are created using curly brackets
add()
To add an item to a set, use the ____ method
update()
To add items from another set into the current set, use the ______ method
remove(), discard()
To remove an item in a set, use the ______, or the ______ method
raise
If the item to remove does not exist, remove() will _____ an error
not raise
If the item to remove does not exist, discard() will ______ an error
union()
The ______ method returns a new set with all items from both sets
update()
The _____ method inserts the items in set two into set one
intersection_update()
The _______ method will keep only the items that are present in both sets
intersection()
The ______ method will return a new set, that only contains the items that are present in both sets
symmetric_difference_update()
The __________ method will keep only the elements that are NOT present in both sets
symmetric_difference()
The _______ method will return a new set, that contains only the elements that are NOT present in both sets
Dictionaries
_______ are used to store data values in key:value pairs and are written in curly brackets
keys()
The ____ method will return a list of all the keys in the dictionary
values()
The ______ method will return a list of all the values in the dictionary
update()
The ____ method will update the dictionary with the items from a given argument.
pop()
The ___ method removes the item with the specified key name
popitem()
The _____ method removes the last inserted item in dictionary
del
The ___ keyword removes the item with the specified key name
clear()
The ____ method empties the dictionary