Cards (119)

    • The sequence control structure executes instructions in the order they are written.
    • In a sequence control structure, instructions are executed one after the other.
    • Match the control structure with its example:
      Sequence ↔️ `print("Hello"); print("World");`
      Selection ↔️ `if x > 0: print("Positive")`
      Iteration ↔️ `for i in range(5): print(i)`
    • What are the two main types of loops used in programming?
      `for` and `while`
    • What is the primary purpose of the selection control structure?
      Choose execution paths
    • Which control structure allows programs to make decisions based on conditions?
      Selection
    • What is the main purpose of control structures in managing program flow?
      Determine execution sequence
    • Why are control structures important for creating dynamic programs?
      Enable adaptive behavior
    • The `if-else` statement is used in selection to make decisions based on conditions.
      True
    • What is the role of control structures in determining the order of instruction execution?
      Control program flow
    • What type of loops are used in iteration to repeat a set of instructions?
      `for` and `while`
    • Iteration control structures repeat a set of instructions using loops such as `for` and while.
    • Loops are used in iteration control structures to repeat a set of actions.
    • What is the primary purpose of control structures in managing program flow?
      Determine execution sequence
    • Why are control structures important for creating dynamic programs?
      Enable adaptive behavior
    • The `if-else` statement is used to choose between different execution paths based on a condition.
      True
    • Mastering control structures is crucial for writing efficient, flexible, and responsive applications.

      True
    • The `if-else` statement executes one block of code if the condition is true and another block if it is false.

      True
    • The `if-else` statement evaluates a condition
    • Why are selection control structures important in programming?
      Enable programs to adapt
    • Sequence control structures execute instructions in the order they are written.

      True
    • What is the primary purpose of control structures in managing program flow?
      Determine execution sequence
    • How are instructions executed in a sequence control structure?
      In sequential order
    • The `if-else` statement evaluates a condition
    • The two primary types of loops are for and while loops.
    • A for loop is used to iterate a specific number of times or to loop over each element in a collection.
    • A nested control structure is one control structure placed inside another control structure to handle complex scenarios.
    • Order the main types of control structures:
      1️⃣ Sequence
      2️⃣ Selection
      3️⃣ Iteration
    • Control structures enable programmers to create dynamic and responsive programs.

      True
    • What is the primary purpose of control structures in programming?
      Manage program flow
    • Control structures are not essential for creating dynamic programs.
      False
    • Control structures allow programmers to structure their code effectively by managing program flow
    • The iteration control structure uses loops to repeat instructions multiple times
    • Selection control structures use conditional statements to choose between different paths
    • Selection control structures enable programs to adapt their behavior based on user input.

      True
    • The `while` loop repeats a block of code as long as a condition is true.

      True
    • Python uses indentation for code blocks, while Java uses curly braces {}.

      True
    • Python uses 'elif' for multiple conditions, while Java uses 'else if'.

      True
    • What replaces curly braces in Python for defining code blocks?
      Indentation
    • Nested control structures enhance a program's ability to handle complex scenarios.
      True