A developer wants to process items from a list until a certain condition is met, after which they want to stop processing even if items remain in the list. What loop control mechanism should they use?

  • break statement
  • continue statement
  • pass statement
  • return statement
The 'break statement' is used to exit a loop prematurely when a certain condition is met. It allows the developer to stop processing items in the list even if there are remaining items to be processed.
Add your answer
Loading...

Leave a comment

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