0% found this document useful (0 votes)
7 views

Python looping control statements (2)

Uploaded by

pugazhm125
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Python looping control statements (2)

Uploaded by

pugazhm125
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Python Programming

- Neowep software technologies

Looping control statements:

In Python, there are three primary loop control statements:

1. break

2. continue

3. pass
break
Def:

 break statement in python is used to terminate a loop prematurely.


 This statement is useful when you want to stop a loop once a certain
condition is met

Example:

for i in range(1, 11):


if i == 5:
break
print(i)
continue

Def:

 continue is used to skip the current iteration of a loop and move on to the
next one.
 This statement is useful when you want to skip over certain values in a loop
without terminating it altogether.

Example:

for i in range(1, 11):


if i == 5:
continue
print(i)
pass
Def:
 pass is a placeholder statement that does nothing.
 It is used when you need to include a statement in your code for syntactical
reasons, but you do not want it to do anything.

Example:

for i in range(1, 11):


pass

You might also like