Which statement is used in a loop to terminate it and transfer the execution to the next statement following the loop?
- break
- continue
- exit
- return
The 'break' statement is used in a loop to terminate it prematurely and transfer the execution to the next statement following the loop. It is often used to exit a loop based on a certain condition.
Loading...
Related Quiz
- You have to develop a script that reads a CSV file and processes the data row by row. Which Python module would you use to read the CSV file?
- In the context of method overriding, what is the role of the super() function?
- _______ is an environment where you can write and execute Python commands one-by-one.
- The _______ decorator in a class is used to turn a method into a class-specific method.
- How would you optimize a Python function that is found to be CPU-bound during profiling?