What is a Python list?
A list is an ordered, mutable collection written with square brackets, such as `[1, 2, 3]`.
Study 6 Python Collections with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a Python list?
A list is an ordered, mutable collection written with square brackets, such as `[1, 2, 3]`.
How do `append()` and `extend()` differ?
`append()` adds one item to the end of a list, while `extend()` adds each item from an iterable.
What is a list comprehension?
A list comprehension creates a new list from an iterable, optionally filtering items, in a compact expression such as `[n * n for n in range(1, 6)]`.
What is a Python tuple?
A tuple is an ordered, immutable collection. Its items cannot be replaced or deleted after creation.
How do you write a one-item tuple?
The comma creates a tuple, so a one-item tuple must be written `(42,)`; `(42)` is just the integer expression `42`.
What does zero-based indexing mean?
Python uses zero-based indexing: the first item has index `0`. A negative index counts backward from the end.
What is Python slice syntax?
A slice uses `sequence[start:stop:step]`; `start` is included, `stop` is excluded, and omitted parts use the sequence boundaries as appropriate.
What does a list slice copy?
For lists, `numbers[:]` creates a shallow copy: it copies the outer list but keeps references to the same nested objects.
What does `second = first` do for a list?
Assignment creates another reference to the same object; it does not automatically copy a collection. Mutating through either reference affects that shared object.
When should you use `enumerate()`?
Use `enumerate()` when a loop needs both each element and its index, as in `for index, color in enumerate(colors):`.
What is a Python dictionary?
A dictionary maps unique, hashable keys to values. It is mutable and written with `key: value` pairs inside braces.
Why use `dict.get()`?
`get()` returns a key's value or a default when the key is absent, avoiding the `KeyError` that direct bracket lookup can raise.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.