You are required to implement a Python loop that needs to perform an action after every iteration, regardless of whether the loop encountered a continue statement during its iteration. Which control structure would you use?

  • do-while loop
  • for loop
  • try-catch block
  • while loop
To perform an action after every iteration, including those with a continue statement, you should use a do-while loop. This loop structure guarantees that the specified action is executed at least once before the loop condition is evaluated.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *