Free Online Flashcard Deck

9 Fundamental Programming Techniques Free Online FlashCards

Study 9 Fundamental Programming Techniques with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is decomposition in programming?

Back

Decomposition divides a large problem into smaller tasks with clear purposes, often implemented as independently understandable and testable functions.

02
Front

What initial value does a sum accumulator use?

Back

Initialize an addition accumulator to 0. Other common identities are 1 for products, 0 for counts, [] for collections, and {} for key-value data.

03
Front

How should Python test whether an item exists?

Back

Use the `in` operator when only membership matters. A set is especially useful for repeated membership tests because it stores unique values.

04
Front

What is an early return in a linear search?

Back

A linear search examines items from beginning to end and can return immediately when it finds a match, avoiding unnecessary work.

05
Front

Which Python tool provides an index and value together?

Back

Use `enumerate` when both the position and the value of each item are needed during iteration.

06
Front

What does filtering do to a collection?

Back

Filtering keeps items that satisfy a condition, so it can change how many items are present. A list comprehension is concise for a simple filter.

07
Front

How does transformation differ from filtering?

Back

Transformation converts each input item into a corresponding output item; unlike filtering, the number of items usually remains the same.

08
Front

What is the usual order of a data-processing pipeline?

Back

A common pipeline obtains data, validates or cleans it, filters unwanted items, transforms the remainder, and then reduces or summarizes it.

09
Front

Which four categories improve test-case coverage?

Back

Typical, boundary, invalid, and special cases. Together they test ordinary inputs, limits, incorrect data, and situations such as duplicates or missing values.

10
Front

What does a Python `assert` test?

Back

An `assert` compares an actual result with an expected result and raises an `AssertionError` when the comparison fails.

11
Front

What is a systematic debugging workflow?

Back

Reproduce the failure, read the traceback, reduce it to a minimal example, inspect values, form one hypothesis, make one focused change, and retest.

12
Front

How do syntax errors differ from runtime exceptions?

Back

A syntax error prevents valid program structure, while an exception occurs during execution of a syntactically valid program.