1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
in which python data structures can you access elements via index?
lists and tuples
in which python data structures can you access elements via keys?
dictionaries
how do you access nested lists/dictionaries?
two []
which python data structures can be concatenated using +?
lists and tuples
can you concatenate a set?
yes, using .union()
what can you nest in a list?
list, set, tuple, dictionary
what can you nest in a tuple?
list, set, tuple, dictionary
what can you nest in a set?
tuple
what can you nest in a dictionary key?
tuple
what can you nest in a dictionary value?
list, tuple, set, dictionary
how to add elem to list?
.append(elem), .insert(ind, elem)
how to add elem to tuple?
immutable so N/A
how to add elem to set?
.add(one elem), .update(multiple elem)
how to add elem to dictionary
d[key] = val, .update({key; val})
how to remove elem from list?
.pop(ind), .remove(elem)
how to remove elem from set?
.discard(elem)
how to remove elem from tuple?
immutable so N/A
how to remove elem from dictionary?
.pop(“key”)