What this deck covers
This deck focuses on Lists, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Study Lists in AP Computer Science Principles with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
How do you convert a string to a list of characters?
Tap card or press Space to flip
list(string). Converts each character into a separate list element.
How well did you know it?
Card 1 / 78
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Lists, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: list(string). Converts each character into a separate list element.
Answer: The number of times x appears in the list. Returns frequency of occurrence for the specified element.
Answer: min(list). Built-in function that finds the smallest comparable element.
Answer: Removes all elements from the list. Empties the list completely, leaving it with zero elements.
Answer: list.reverse(). Reverses elements in-place without creating a new list.
Answer: List comprehension filtering positive elements. Combines iteration with conditional filtering in one expression.
Answer: list = []. Creates an empty list using square bracket notation.
Answer: Adds elements from the iterable to the end of the list. Extends the list with multiple elements from another collection.
Answer: list.remove(value). Removes the first matching value from the list.
Answer: A shallow copy of the list. Creates a new list object with the same elements.
Answer: list.remove(value). Removes the first matching value from the list.
Answer: Adds element x to the end of the list. Appends to the end, increasing list length by 1.
Answer: A list of squares of elements. Applies exponentiation operation to each list element.
Answer: list1 + list2. Plus operator combines lists into a new list object.
Answer: Sorts the list in ascending order. Modifies the original list in-place using default ascending order.
Answer: Inserts element x at the specified index. Places element at specific position, shifting others right.
Answer: The list in reverse order. Negative step creates a reversed copy of the list.
Answer: for element in list:. Iterates through each element without using indices.
Answer: 'separator'.join(list). Combines string elements with specified separator between them.
Answer: The index of the first occurrence of x in the list. Returns position of first match; raises ValueError if not found.
Answer: Sorts the list in ascending order. Modifies the original list in-place using default ascending order.
Answer: A list that contains other lists as elements. Enables creation of multi-dimensional data structures.
Answer: list.reverse(). Reverses elements in-place without creating a new list.
Answer: Checks if an element exists in the list. Returns True if element found, False otherwise.
Answer: A sublist from index start to end-1. End index is exclusive, so it's not included in result.
Answer: A shallow copy of the list. Creates a new list object with the same elements.
Answer: Adds element x to the end of the list. Appends to the end, increasing list length by 1.
Answer: O(1). Constant time since it adds to the end only.
Answer:
Answer: The number of elements in the list. Built-in function that counts all elements in the list.
Answer: list1 + list2. Plus operator combines lists into a new list object.
Answer: list[-1]. Negative indexing starts from the end of the list.
Answer: Adds elements from the iterable to the end of the list. Extends the list with multiple elements from another collection.
Answer: Using the '==' operator. Compares element by element for both content and order.
Answer:
Answer: Inserts element x at the specified index. Places element at specific position, shifting others right.
Answer: O(1). Constant time since it adds to the end only.
Answer: To access a specific element in the list by its position. Indices provide direct access to elements without iteration.
Answer: Extracting a portion of the list using indices. Creates sublists using start and end index boundaries.
Answer: Mutable, ordered collection. Lists can be modified after creation and maintain element order.
Answer: max(list). Built-in function that finds the largest comparable element.
Answer: Extracting a portion of the list using indices. Creates sublists using start and end index boundaries.
Answer: The number of times x appears in the list. Returns frequency of occurrence for the specified element.
Answer: list.pop(index). Removes and returns the element at the specified position.
Answer:
Answer: The index of the first occurrence of x in the list. Returns position of first match; raises ValueError if not found.
Answer: List comprehension filtering positive elements. Combines iteration with conditional filtering in one expression.
Answer: Checks if an element exists in the list. Returns True if element found, False otherwise.
Answer: A sublist from index start to end-1. End index is exclusive, so it's not included in result.
Answer: list[-1]. Negative indexing starts from the end of the list.
Answer: list = []. Creates an empty list using square bracket notation.
Answer: sum(list). Built-in function that adds all numeric elements together.
Answer: sum(list). Built-in function that adds all numeric elements together.
Answer: A list that contains other lists as elements. Enables creation of multi-dimensional data structures.
Answer: Mutable, ordered collection. Lists can be modified after creation and maintain element order.
Answer: 'separator'.join(list). Combines string elements with specified separator between them.
Answer: max(list). Built-in function that finds the largest comparable element.
Answer: To access a specific element in the list by its position. Indices provide direct access to elements without iteration.
Answer: Using the '==' operator. Compares element by element for both content and order.
Answer: IndexError: pop from empty list. Cannot remove elements from a list with no elements.
Answer: O(1) for last element, O(n) for others. Last element removal is instant; others require shifting.
Answer: IndexError: list index out of range. Index 1 doesn't exist in a list with only one element.
Answer: min(list). Built-in function that finds the smallest comparable element.
Answer: The number of elements in the list. Built-in function that counts all elements in the list.
Answer: list.pop(index). Removes and returns the element at the specified position.
Answer: O(1) for last element, O(n) for others. Last element removal is instant; others require shifting.
Answer: A concise way to create lists. Enables functional programming style for list creation.
Answer:
Answer: A list of squares of elements. Applies exponentiation operation to each list element.
Answer: for element in list:. Iterates through each element without using indices.
Answer: list(string). Converts each character into a separate list element.
Answer: IndexError: list index out of range. Index 1 doesn't exist in a list with only one element.
Answer: The list in reverse order. Negative step creates a reversed copy of the list.
Answer: A concise way to create lists. Enables functional programming style for list creation.
Answer: A collection of elements, typically of the same type, in a specific order. An ordered data structure that allows indexing and modification.
Answer: IndexError: pop from empty list. Cannot remove elements from a list with no elements.
Answer: A collection of elements, typically of the same type, in a specific order. An ordered data structure that allows indexing and modification.
Answer: Removes all elements from the list. Empties the list completely, leaving it with zero elements.