explain the break statement in Python with an example
Answers
Answered by
1
The break statement is used to terminate the loop when a certain condition is met. ... For example, lets say we are searching an element in a list, so for that we are running a loop starting from the first element of the list to the last element of the list.
Answered by
0
Answer:
Python break statement
The break is a keyword in python which is used to bring the program control out of the loop. The break statement breaks the loops one by one, i.e., in the case of nested loops, it breaks the inner loop first and then proceeds to outer loops.
Similar questions