a sequence of values accessed by their offset from the beginning of the sequence.
Back
A tuple
Front
Immutable sequence of arbitrary items.
Back
local
Front
The variables defined within a function are only available to the function in its ________ namespace.
Back
Extends the list by appending all the items from the iterable.
Front
What does this list method do?
list.extend(iterable)
Back
Removes the item at the given position in the list, and returns it. If no index is specified, it will remove and return the last item in the list.
Front
What does this list method do?
list.pop([i])
Back
list, set, and dict
Front
Which types of built-in objects are mutable?
Back
Reverses the elements of the list in place.
Front
What does this list method do?
list.reverse()
Back
Returns a shallow copy of the list. equivalent to a[:].
Front
What does this list method do?
list.copy()
Back
1. Sets cannot have multiple occurrences
2. Sets have unordered values.
3. Sets can only contain immutable (hashable) items.
Front
What are the differences between sets and lists?
Back
Removes the first item from the list whose value is equal to x.
Front
What does this list method do?
list.remove(x)
Back
A dictionary
Front
An unordered, changeable, and indexed collection of unique keys and associated values. We use these to store and look up things by name.
Back
Sorts the items of the list in place.
Front
What does this list method do?
list.sort(key=None, reverse =False)
Back
[]
Front
How do we create a list?
Back
{}
Front
What do we use to create a dictionary?
Back
Generator
Front
A python sequence creation object. You can use it to iterate through potentially huge sequences without creating and storing the entire sequence in memory at once.
Back
It is an anonymous function expressed as a single statement. It takes one argument that is separated by its definition by a colon.
Ex. edit_story(stairs, lambda word: word.capitalize() + '!')
Front
What is a lambda function?
Back
Mutable means you CAN add, delete, or change items after the object has been defined.
Immutable means you CAN'T make changes to the object after it has been defined.
Front
What is the difference between mutable and immutable?
Back
Adds an item to the end of the list.
Front
What does this list method do?
list.append(x)
Back
Decorator
Front
A function that takes one function as input and returns another function.
Back
Removes all items from the list.
Front
What does this list method do?
list.clear()
Back
JSON (JavaScript Object Notation)
Front
A human-readable text format for data interchange that defines attributes and values in a document.
Back
Inserts an item at a given position. The first argument is the index of the element before which to insert.
Front
What does this list method do?
list.insert(i,x)
Back
global variables
Front
The main part of a program defines the global namespace; thus, the variables in that namespace are...
Back
returns a dictionary of the contents of the global namespace.
Front
What does the globals() function do?
Back
int, float, bool, string, tuple, unicode
Front
Which types of built-in objects are immutable?
Back
Returns the number of times x appears in the list.
Front
What does this list method do?
list.count(x)
Back
Returns a dictionary of the contents of the local namespace.
Front
What does the locals() function do?
Back
An object
Front
Everything in python is implemented as...
Back
Lists are mutable; Tuples are immutable
Front
What is the main difference between lists and tuples?