break statement in python
Python break statement is used to terminate or stop the execution of a loop based on some condition. As soon as the loop encounters break keyword, it is terminated and the execution resumes from the first line after the loop. break use case Suppose there is a large list of names, a dictionary of student objects or a tuple of numbers and you are searching for a particular value in these collections. Now if the element you are searching is found at the second position, why should you check all the other elements. In such a scenario, break is used. break is also used toRead More →