Module-3 (Control Statement)
Module-3 (Control Statement)
Control statement
Iterative statement
Content
• If/else
• Elif
• Iterative statement
Control Statement
• flow of any program is called control statement.
• There are two types of control statement:-
• 1 Selection or forward statement:-
if
else if
elif
nested if
• 2 loop or iteration statement:-
2 loop or iteration statement:-
Syntax:-
Var_name=start
While condition:
Statement executed until condition is true
Increament/decreament
Example
1 print a number from 1 to 10 by using while loop
i=1
While i<=10:
print(i)
i=i+1
Thank you