In which type of loop structures can the break statement be used in Python?

  • both for and while loops
  • for loop
  • neither for nor while loops
  • while loop
The 'break' statement can be used in both 'for' and 'while' loops in Python. It is used to exit the loop prematurely based on a certain condition, making it a useful control structure for loop termination.
Add your answer
Loading...

Leave a comment

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