Posts

Showing posts with the label break and continue

Python3 break and continue Statements

Image
Python break and continue Statements break and continue statements              In Python , break and continue statements can alter the flow of normal loop. Loop iterate over a block of code until test expression is false, but sometimes we wish to terminate the current iteration or even the whole loop without checking test expression.   The break and continue statements are used in these cases. Python Break Statement     Syntax:                 break Flow Chart:                                         Working:                     Eg:        nums=[1,2,3,4]        for num in nums:              if num==4:                 ...