What is control flow statements in python?

Description

To see the control flow statements in python3.

Break statement.

  The break statement is used for
premature termination of the current loop.

  After abandoning the loop,
execution at the next statement is resume

Continue statement.

  The pass statement is a null
operation.

Pass statement.

  Nothing happens when it executes.

  The continue statement in Python returns the control to the beginning of the current loop.

#break statement
print(“*****Break statement output*****”)
string=’sathish’
for i in string:
if(i==’i’):
break
#it did not take below print statement
print(“this is break statement”)
print(“Curretnt name is:”,i)

#continue statement
print(“*****continue statement output*****”)
string=’sathish’
for i in string:
if(i==’i’):
continue
print(“this is continue statement”)
print(“Curretnt name is:”,i)

#pass statement
print(“*****Pass statement output*****”)
string=’sathish’
for i in string:
if(i==’i’):
pass
print(“this is pass statement”)
print(“Curretnt name is:”,i)

Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit