Python Programming and Algorithmic Analysis Practice Flashcards

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

1/51

flashcard set

Earn XP

Description and Tags

A comprehensive set of vocabulary flashcards derived from lecture notes covering Python language mechanics, algorithms, databases, and functional programming concepts.

Last updated 11:33 PM on 6/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

52 Terms

1
New cards

dir()

A built-in function that returns a list of identifiers defined in the current scope.

2
New cards

name

A module attribute that evaluates to "main" when the module is executed directly.

3
New cards

globals()

A function that returns a dictionary representing the current module's globally accessible attributes.

4
New cards

locals()

A function that returns a dictionary containing variables restricted to the local scope, such as parameters inside a function.

5
New cards

LEGB Rule

The sequence Python uses to resolve name references: Local, Enclosing, Global, and Built-in.

6
New cards

Shadowing

A situation where a local variable is defined with the same name as a global variable, causing the local variable to take precedence in that scope.

7
New cards

dict

An internal dictionary used by objects to store their data attributes.

8
New cards

mappingproxy

The structure of a class dictionary that contains methods, class-level attributes, and special built-in data like module and doc.

9
New cards

@staticmethod

A decorator used for methods that are called on a class rather than an object and do not receive an automatic self parameter.

10
New cards

@classmethod

A decorator for methods that are called on the class as a whole and automatically receive the class itself (conventionally named cls) as the first parameter.

11
New cards

Factory Methods

Methods used to provide descriptive, alternative ways to instantiate objects, often implemented as class methods.

12
New cards

Positional Arguments

Arguments matched to parameters based strictly on the order in which they are provided.

13
New cards

Keyword Arguments

Arguments matched to parameters explicitly by their names.

14
New cards

Mutable Default Trap

A naming for the issue where mutable objects used as default arguments persist mutations across future function calls because they are stored within the function object itself.

15
New cards

*args (Tuple-Packing)

A parameter that packs any varying number of leftover positional arguments into a single tuple.

16
New cards

**kwargs (Dictionary-Packing)

A parameter that packs all leftover keyword arguments into a dictionary; it must be the last parameter in the function signature.

17
New cards

Keyword-Only Parameters

Parameters placed after a bare * in a definition that must be passed by name.

18
New cards

Positional-Only Parameters

Parameters placed to the left of a / in a definition that cannot be passed as keyword arguments.

19
New cards

Syntactic Sugar

Cleaner or automated syntax, such as the with statement, provided for handling setup and teardown actions.

20
New cards

Context Management Protocol

The requirement that an object must implement the enter and exit methods to be used in a with statement.

21
New cards

Asymptotic Analysis

The measurement of the growth rate of an algorithm's resource usage (time or memory) as the problem size nn approaches infinity.

22
New cards

O-Notation (Big-O)

A formal notation where g(n)g(n) serves as an upper bound for the growth rate of a function f(n)f(n), ignoring small problem sizes and constant speed factors.

23
New cards

Space Complexity

The measurement of memory growth as the problem size increases; for example, a standard Python list storing nn items has a space complexity of O(n)O(n).

24
New cards

Sequential (Linear) Search

A searching algorithm that checks elements one by one, with a worst-case time complexity of O(n)O(n), best used for unsorted lists.

25
New cards

Binary Search

A searching algorithm for sorted lists that halves the search space at every step, resulting in a worst-case time complexity of O(log(n))O(log(n)).

26
New cards

Scalar Value

A value in a database column that cannot be broken down into smaller, separately meaningful pieces.

27
New cards

Primary Key

A column or combination of columns that uniquely identifies every row in a table.

28
New cards

Foreign Key

A column that stores the primary key of a row from another table to establish a relationship between the two.

29
New cards

Referential Integrity

A database constraint enforcing that a foreign key must refer to a row that actually exists in the linked table.

30
New cards

Injection Attack

A security threat where malicious users inject arbitrary SQL commands into formatted SQL strings via user input.

31
New cards

Transaction

A sequence of database operations treated as a single "all-or-nothing" unit to maintain data consistency.

32
New cards

Hashability

The requirement for an object to support the hash and eq methods so it can be stored in sets or as dictionary keys.

33
New cards

Generator Expression

A syntax resembling a list comprehension but using parentheses, which creates a generator that produces values lazily.

34
New cards

Iterable

An object, such as a list or string, that can produce a sequence of values one at a time using the iter method.

35
New cards

Iterator

A separate, temporary object that manages the state of a single, ongoing iteration by implementing next and iter methods.

36
New cards

Generator Function

A function containing at least one yield statement that returns a generator object and executes in "fits and starts."

37
New cards

yield from

A statement used to easily yield every element from an iterable one at a time within a generator.

38
New cards

Truthiness

The evaluation of objects as true or false in conditional contexts using a fallback process involving bool and len.

39
New cards

Sequence Protocol

A protocol where a class implements both len and getitem (for non-negative integers), automatically granting it iterability and reverse iteration.

40
New cards

Reflected Operators

Methods like radd that Python calls on the right-hand operand if the left-hand operand does not support a binary operation.

41
New cards

Liskov Substitution Principle

A principle stating that derived classes should be safely substitutable for their base classes.

42
New cards

Method Resolution Order (MRO)

The linearized order, determined by the C3 algorithm, in which base class dictionaries are searched for attributes in multiple inheritance.

43
New cards

RecursionError

The exception raised by Python when a recursive function reaches the run-time stack limit, often due to a missing base case.

44
New cards

Tail Call

A function call that occurs as the absolute last step of a function, returning the result without any additional work.

45
New cards

Memoization

A technique of storing the results of previous function calls to avoid redundant calculations, improving time complexity in recursion.

46
New cards

Dynamic Programming

A bottom-up approach to solving recursively shaped problems by starting at the base cases and building forward iteratively.

47
New cards

First-Class Functions

Functions treated as values that can be assigned to variables, passed as arguments, and returned as results.

48
New cards

Higher-Order Function

A function that accepts other functions as arguments, returns them as results, or both.

49
New cards

Lambda Expression

An anonymous, unnamed function defined in a single expression that can support positional and keyword arguments.

50
New cards

Decorator

A function that accepts another function as an argument and returns a replacement function to extend or modify its behavior.

51
New cards

Abstract Base Class (ABC)

A class that defines a protocol or set of requirements that must be implemented by any concrete subclass, inherited from abc.ABC.

52
New cards

Virtual Subclassing

The process of using ABCName.register(ClassName) to instruct Python to treat a class as if it implements an ABC's protocol without actual inheritance.