M102 - Acquérir les bases de l'algorithmique et Python

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/35

flashcard set

Earn XP

Description and Tags

Comprehensive flashcards covering problem modeling, algorithmic foundations, structured programming, data structures, and Python development from Module 102.

Last updated 11:03 AM on 9/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

36 Terms

1
New cards

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.

2
New cards

What three essential elements are focused on during problem analysis?

Desired results (outputs), processing (actions performed to reach the result), and required data (inputs).

3
New cards

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).

4
New cards

What are the four main categories of data processing?

Sequential processing, conditional processing, iterative processing, and recursive processing.

5
New cards

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.

6
New cards

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).

7
New cards

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.

8
New cards

What arithmetic operations are specific to the integer data type in algorithmics?

div (integer division quotient) and mod (remainder of integer division).

9
New cards

In algorithmics, what are the two format representations for real numbers?

Standard decimal format (using a point, e.g., −3.2467-3.2467) and scientific notation format (aEbaEb, e.g., 3.47E23.47E2).

10
New cards

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.

11
New cards

What is the standard structural layout of an algorithm written in pseudo-code?

Algorithm header (), constants declaration (Const), variables declaration (Var), and the algorithm body (Début … Fin).

12
New cards

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.

13
New cards

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.

14
New cards

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.

15
New cards

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.

16
New cards

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.

17
New cards

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.

18
New cards

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.

19
New cards

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−1n-1.

20
New cards

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).

21
New cards

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.

22
New cards

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).

23
New cards

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.

24
New cards

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 (:).

25
New cards

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.

26
New cards

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.

27
New cards

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.

28
New cards

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).

29
New cards
<p>What components make up the structure of a Python lambda function as shown in the diagram?</p>

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.

30
New cards

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}).

31
New cards

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).

32
New cards

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.

33
New cards

What is the difference between math.ceil() and math.floor() functions in Python?

math.ceil(x) rounds xx upward to the nearest integer, while math.floor(x) rounds xx downward to the nearest integer.

34
New cards

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.

35
New cards

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.

36
New cards

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.