sponsor

sponsor

Slider

Recent Tube

Business

Technology

Life & style

Games

Sports

Fashion

» » break Statement

Python में break Statement Loop को किसी expression पर बंद कर देता है |

Syntax for break Statement

break

Example for break Statement

Example में अगर 'n' को 4 मिल जाता है तब for Loop का iteration बंद हो जाता है |
Source Code :
nums = [1, 2, 3, 4, 5]
for n in nums :
   print(n)
   if(n == 4):
      break   
Output :
1
2
3
4

«
Next
Newer Post
»
Previous
Older Post

No comments:

Leave a Reply