What are Loop Control Statements in Python | EP-42 Break, Continue & Pass in Python | Python Loops

Subscribers:
28,000
Published on ● Video Link: https://www.youtube.com/watch?v=Ue1Lxlm-J9U



Duration: 0:00
49 views
0


Loop control statements change execution from their normal sequence.
When execution leaves a scope, all automatic objects that were created in that scope are destroyed. Python supports the following control statements:

1. Break statement
2. Continue statement
3. Pass statement
"""

1. Python Break Statement
"""Python break is used to terminate the execution of the loop.
break statement in Python is used to bring the control out of the loop when some external condition is triggered. break statement is put inside the loop body (generally after if condition). It terminates the current loop, i.e., the loop in which it appears, and resumes execution at the next statement immediately after the end of that loop. If the break statement is inside a nested loop, the break will terminate the innermost loop.
syntax:
Loop{
Condition:
break
}
"""
for i in range(11):
print(i)

if i == 4:
break

for i in range(1,16):
mul = i * 3
print(mul,"mul")
if mul == 30:
break

2. Python Continue Statement
""" Python Continue Statement skips the execution of the program block after the continue statement and forces the control to start the next iteration.ie,when the continue statement is executed in the loop, the code inside the loop following the continue statement will be skipped for the current iteration and the next iteration of the loop will begin.
syntax:
loop
if condition:
continue
else:
print(x)
"""
for i in range(1,11):
if i==1:
continue
else:
print(i,"continue")


3. Python Pass Statement
"""
The Python pass statement is a null statement. But the difference between pass and comment is that comment is ignored by the interpreter whereas pass is not ignored.
Syntax:
pass
When the user does not know what code to write, So user simply places a pass at that line. Sometimes, the pass is used when the user doesn’t want any code to execute. So users can simply place a pass where empty code is not allowed, like in loops, function definitions, class definitions, or in if statements. So using a pass statement user avoids this error."""

for i in range(10):
pass

#PythonTutorial #PythonProgramming #PythonLoops #LoopControlStatements #PythonForBeginners #PythonBreakContinuePass #LearnPython #CodingTutorial #ProgrammingTips #PythonBasics #Python #LoopControl #BreakContinuePass #ProgrammingTutorial #LearnPython #Code #Developer #Break #Continue #Pass

Connect With Us:
—————————————
➡️ Website: https://www.cybrosys.com/
➡️ Email: info@cybrosys.com
➡️ Twitter:   / cybrosys  
➡️ LinkedIn:   / cybrosys  
➡️ Facebook:   / cybrosystechnologies  
➡️ Instagram:   / cybrosystech  
➡️ Pinterest:   / cybrosys  




Other Videos By Cybrosys Technologies


2024-09-25Function Arguments in Python| EP-44 Types of Function Arguments in Python| Types of Python Arguments
2024-09-24ARM - Movie Night with Cybrosians 🎦🍿⚡️🎞️ | Ajayante Randam Moshanam | Tovino Thomas | Jithin Lal
2024-09-24What is Python Functions | EP-43 Python Functions | Functions in Python | Free Python Tutorials
2024-09-24Leave dashboard in Horilla HRMS | Free Leave Management Software | HRMS Leave Management System
2024-09-24Odoo 18 Improved Dashboard App | Odoo 18 Dashboard | Odoo 18 New Features | Odoo 18 Release Date
2024-09-23How to Create a Mail Template in Horilla HRMS | Free HR Software | Open Source HRMS Software
2024-09-23Sub Thread in Odoo 18 Discuss | Odoo 18 Features | Odoo 18 Release Date | Odoo 18 Discuss App
2024-09-20Loyalty Cards & E-Wallets in Portal in Odoo 18 | Odoo 18 New Features | Odoo 18 Release Date
2024-09-20How to Create a New Disciplinary Action Type in Horilla HRMS| Employee Disciplinary Tracking in HRMS
2024-09-20EP-2 Filter Rules & Domains | Odoo 17 Studio | Odoo 17 Features | Odoo 17 Tutorials
2024-09-19What are Loop Control Statements in Python | EP-42 Break, Continue & Pass in Python | Python Loops
2024-09-18What is While Loop in Python | EP-41 While Loop in Python| Python While Loops| Free Python Tutorials
2024-09-18How to Customize Your Own Apps in Odoo 17 Studio | EP-1 Customize Your App | Odoo 17 Studio Module
2024-09-18Animated GIF in Odoo 18 Discuss | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18 Updates
2024-09-17Nested For Loops in Python | EP-40 For Loop Part-2| How to Use Loops with Zip Function| Python Zip()
2024-09-16What is For Loops in Python | EP-39 For Loops in Python | Python For Loops | Free Python Tutorials
2024-09-16How to Create User Permissions & Groups in Horilla HRMS| How to Set Access Rights for Specific Users
2024-09-16How to Manage Split Delivery Orders in Odoo 18 | Split Delivery Orders in Odoo 18 | Odoo 18 Features
2024-09-14🌸Cybro Onam 2024 | IT Company Onam Celebrations @ Cybrosys | Onam Galatta | Office Onam Celebration🌼
2024-09-13Mr🕺🏻& Ms💃🏼 Onam 2024 | Malayali Manka & Kerala Sreeman | IT Company Onam @ Cybrosys | Onam in Office
2024-09-13What is If Else Conditional Statements in Python | EP -38 Python If Else Statements | Python If Else