1/35
Comprehensive flashcards covering problem modeling, algorithmic foundations, structured programming, data structures, and Python development from Module 102.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What are the three main phases in the problem-solving process?
Analysis of the problem, Problem resolution (conception and realization of the solution), and Evaluation of the solution.
What three essential elements are focused on during problem analysis?
Desired results (outputs), processing (actions performed to reach the result), and required data (inputs).
What are the three methods used to formulate a data processing solution during problem analysis?
Analogy (finding similarities from previous problems), Contrast (finding differences or antagonistic arguments), and Contiguity (finding concomitant or simultaneous events).
What are the four main categories of data processing?
Sequential processing, conditional processing, iterative processing, and recursive processing.
What distinguishes a top-down analysis approach from a bottom-up approach?
A top-down approach divides a complex problem into smaller sub-modules down to primitive actions, whereas a bottom-up approach starts by designing fundamental primitive components and combining them into higher-level modules.
What three components constitute a computer object in algorithmics?
An identifier (its name), a type (which defines possible values, memory size, and applicable operations), and a value (its unique content).
What is the primary difference between a variable and a constant in an algorithm?
A constant's value remains unchanged throughout program execution and must be defined upon declaration, whereas a variable's value can be modified by actions during execution.
What arithmetic operations are specific to the integer data type in algorithmics?
div (integer division quotient) and mod (remainder of integer division).
In algorithmics, what are the two format representations for real numbers?
Standard decimal format (using a point, e.g., −3.2467) and scientific notation format (aEb, e.g., 3.47E2).
What is the result of evaluating the logical truth table for A ET B and A OU B when A is True and B is False?
A ET B is False, and A OU B is True.
What is the standard structural layout of an algorithm written in pseudo-code?
Algorithm header (
How does assignment differ from equality comparison in pseudo-code?
Assignment is denoted by := and assigns a value/expression on the right to the variable on the left, whereas equality comparison checks if two values are equal.
Under what condition does a TantQue (While) loop execute its body zero times?
A TantQue loop executes zero times if the condition evaluates to False at the very beginning before entering the loop.
How does a Répéter … Jusqu'à loop differ from a TantQue loop regarding execution count?
A Répéter … Jusqu'à loop always executes its body at least once because the exit condition is checked at the end, whereas a TantQue loop checks the condition at the start and can execute zero times.
What is the difference between a formal parameter and an effective parameter in modular programming?
Formal parameters are placeholders defined in the function or procedure header, while effective parameters are the actual variables, constants, or expressions passed during the function/procedure call.
What happens to the original variable when passed by value versus when passed by address (reference)?
When passed by value, a copy is transmitted and modifications do not affect the original variable; when passed by address, the memory reference is transmitted and modifications directly alter the original variable.
What is local variable masking (or shadowing)?
Local variable masking occurs when a local variable declared inside a sub-program shares the same name as a global variable, making the global variable inaccessible within that sub-program scope.
What is a vector array in algorithmics?
A vector array is a one-dimensional data structure that stores a fixed maximum number of elements of the same data type under a single variable name.
How does the Selection Sort algorithm operate on an array?
It finds the index of the minimum element in the unsorted portion of the array and swaps it with the element at the beginning of that portion, repeating for each position from index 1 to n−1.
How does the Bubble Sort algorithm determine when sorting is complete?
It continuously iterates through adjacent elements swapping out-of-order pairs until a full pass completes with no swaps performed (échange = Faux).
What is the main operational mechanism of Insertion Sort?
It takes elements one by one and inserts each into its correct position within the already sorted sub-list preceding it.
What are three core criteria used to evaluate programming languages?
Readability (ease of reading and understanding), Writeability (ease of writing programs), and Reliability (degree of confidence in correct execution under varying conditions).
What key characteristics define the Python programming language?
Python is an interpreted, portable, free, dynamically typed, object-oriented programming language that uses indentation to structure code blocks.
How are code blocks defined in Python instead of using curly braces or Début/Fin keywords?
Python uses line indentation (typically 4 spaces or a tab) following a header line ending with a colon (:).
What are the formatting parameters end and sep used for in Python's print() function?
end specifies the character to append at the end of the printed output (default is newline), and sep specifies the separator string inserted between multiple printed arguments.
What is the difference between / and // arithmetic operators in Python?
/ performs float division returning a floating-point result, whereas // performs floor division returning the integer quotient.
What do Python string slice indexing notations s[start:end] and s[::2] produce?
s[start:end] returns substring characters from index start up to but excluding end; s[::2] returns every second character of string s.
What are the main recommendations of PEP 8 regarding naming conventions for variables, functions, and constants?
Variables and function names should be in lowercase with words separated by underscores (snake_case), while constants should be written entirely in uppercase (UPPERCASE).

What components make up the structure of a Python lambda function as shown in the diagram?
It consists of the lambda keyword, followed by argument(s), a colon, and a single-line expression whose result is assigned to a function object.
What are the principal differences between Python Lists, Tuples, Sets, and Dictionaries?
Lists are ordered and mutable ([]); Tuples are ordered and immutable (()); Sets are unordered, unindexed, and contain unique elements ({}); Dictionaries store mutable key-value pairs ({key: value}).
What is the behavior of file opening modes 'r', 'w', 'a', and 'x' in Python's open() function?
'r' opens for reading (error if missing); 'w' opens for writing (overwrites or creates); 'a' opens for appending (creates if missing); 'x' creates a new file (returns error if file exists).
What functions in Python's json module convert between JSON strings and Python data structures?
json.loads() decodes a JSON string into a Python list or dictionary, and json.dumps() encodes a Python object into a JSON string.
What is the difference between math.ceil() and math.floor() functions in Python?
math.ceil(x) rounds x upward to the nearest integer, while math.floor(x) rounds x downward to the nearest integer.
How does exception handling work using try, except, else, and finally blocks in Python?
try holds code that may raise an error; except catches and handles specified exceptions; else executes if no exceptions occur in try; finally always executes regardless of whether an exception occurred.
What is the purpose of Python's built-in pdb module and its set_trace() function?
pdb is an interactive debugger; calling pdb.set_trace() sets a breakpoint in the program where execution pauses to inspect or modify variables and step through code.
What roles do setuptools, PyInstaller, and Sphinx play in Python application deployment?
setuptools builds packages for distribution on PyPI; PyInstaller packages a Python application into a standalone executable file; Sphinx generates documentation in PDF or HTML formats.