What is a sequence in program control flow?
A sequence executes instructions in order, from top to bottom, once each.
Study 4 Control Flow and Logic with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a sequence in program control flow?
A sequence executes instructions in order, from top to bottom, once each.
What does a conditional do?
A conditional selects which statements execute based on whether a Boolean condition is true or false.
How does Python choose among if and elif branches?
Only the first branch whose condition is true runs. If no condition is true, the else branch runs, when present.
What is the difference between = and ==?
= assigns a value, whereas == tests whether two values are equal.
What do Python’s and, or, and not operators do?
and is true only when both expressions are true; or is true when at least one is true; not reverses a Boolean value.
What is short-circuit evaluation?
Short-circuit evaluation stops when the final result is already known. For example, and can avoid division if its first condition is false.
When is a for loop commonly used?
Use a for loop to process each item in a sequence or iterate through a known range of values.
Which values does range(1, 5) produce?
range(1, 5) produces 1, 2, 3, and 4; its ending value, 5, is excluded.
What is an accumulator in a loop?
An accumulator stores a running result that is updated during each loop iteration, such as a sum, count, or product.
How does a while loop control repetition?
A while loop repeats as long as its condition remains true. The condition is tested before each iteration.
What is the difference between break and continue?
break immediately ends the nearest loop, while continue skips the rest of the current iteration and starts the next one.
What is a nested control structure?
A nested structure places one control structure inside another, such as an if statement inside a loop.
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
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.
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
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 focused review of propositional logic, quantifiers, sets, relations, functions, and foundational proof methods in discrete mathematics for computer science.
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.
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.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.