What does it mean that Python strings are immutable?
A string is an immutable sequence of Unicode characters, so operations that seem to modify it return a new string.
Study 5 Collections and String Processing with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does it mean that Python strings are immutable?
A string is an immutable sequence of Unicode characters, so operations that seem to modify it return a new string.
How does Python index sequence elements?
Python uses zero-based indexing: the first element is at index 0, and index -1 refers to the final element.
What do the parts of a Python slice mean?
In sequence[start:stop:step], start is included, stop is excluded, and step controls how far the index advances.
How do append() and extend() differ?
append() adds one item to the end; extend() adds every item from an iterable.
What is a Python tuple?
A tuple is an ordered, immutable sequence, making it suitable for fixed groups of related values.
How can you safely read a possibly missing dictionary key?
A dictionary subscription for a missing key raises KeyError; get() can return None or a supplied default instead.
What are the defining properties of a Python set?
A set stores distinct, hashable values and does not support indexing or slicing.
When should you use discard() instead of remove()?
remove() raises an error if the value is absent; discard() does nothing when the value is absent.
What does enumerate() provide during iteration?
enumerate() supplies both the index and the value while iterating, such as for index, color in enumerate(colors).
What is zip() used for?
zip() pairs corresponding elements from multiple iterables, allowing loops such as for name, age in zip(names, ages).
What is the general form of a list comprehension?
A list comprehension follows [expression for item in iterable if condition], with the if clause optional.
How does a dictionary comprehension construct entries?
A dictionary comprehension uses a key–value expression, such as {number: number ** 2 for number in range(5)}.
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.