Cards (62)

  • Procedural programming structures programs as a series of procedures or functions
  • In procedural programming, the focus is on what an object can do.
    False
  • Functional programming uses concepts like immutability and higher-order functions.

    True
  • The procedural paradigm focuses on how to do something using procedures and control structures
  • The three main programming paradigms are procedural, object-oriented, and functional
  • Functional programming focuses on what the program should do, rather than how it should do it.
    True
  • In the imperative paradigm, the programmer directly manages the control flow of the program.

    True
  • In the declarative paradigm, data is immutable after creation.

    True
  • What is the primary focus of functional programming?
    Evaluation of mathematical functions
  • The Python code `even_numbers = filter(lambda x: x % 2 == 0, numbers)` filters even numbers from a list in a functional style.

    True
  • Programming paradigms are different approaches for writing computer programs.

    True
  • Functional programming is built around the evaluation of mathematical functions
  • The imperative programming paradigm focuses on explicitly telling the computer how to solve a problem.

    True
  • Declarative programming focuses on specifying what you want to achieve rather than how to achieve it.

    True
  • Side effects are minimized in declarative programming to maintain predictability.
    True
  • Immutability in declarative programming ensures data changes after creation.
    False
  • What is considered a side effect in declarative programming?
    Modifying program state
  • Functional programming emphasizes immutable data, which cannot be changed after it is created
  • How does functional programming differ from imperative programming?
    Focuses on what, not how
  • Objects in OOP contain both data and behavior.
    True
  • Procedural programming focuses on how to do something by defining specific steps and control flow.

    True
  • In procedural programming, the focus is on how to do something, not what to do
  • In object-oriented programming, programs are built around objects that contain data and methods
  • The imperative programming paradigm focuses on explicitly telling the computer how to solve a problem by modifying the state of the program
  • The object-oriented paradigm focuses on what an object can do using objects, classes, inheritance, and encapsulation
  • What is the primary focus of procedural programming?
    How to do something
  • What is the central focus of the imperative programming paradigm?
    How to modify state
  • What does the Python code `x = x + 10` do in the imperative paradigm?
    Increases x by 10
  • In declarative programming, a function is considered pure if it has no side effects
  • In functional programming, data cannot be changed after it is created, emphasizing immutability
  • One key concept in object-oriented programming is inheritance
  • Match the programming paradigm with its focus:
    Procedural ↔️ How to do something
    Object-Oriented ↔️ What an object can do
    Functional ↔️ What the program should do
  • Procedural programming relies on control structures to manage program flow.

    True
  • In imperative programming, instructions are executed sequentially
  • Immutability is a key concept in declarative programming that prevents data from being modified
  • To filter even numbers from a list in a declarative style, you specify the condition
  • Declarative code specifies the steps for filtering even numbers from a list.
    False
  • Match the higher-order functions with their purpose:
    map() ↔️ Applies a function to each element of a sequence
    filter() ↔️ Returns elements that satisfy a condition
    reduce() ↔️ Combines elements of a sequence
  • What is the focus of object-oriented programming (OOP)?
    What an object can do
  • Encapsulation in OOP hides the internal implementation details of an object