subjects

Dropdown Menu

Monday 29 March 2021

Control statements

 

Control statements are used to change the order of sequence of execution based on some conditions. Various control statements in python are if statement, for statement,           while statement, break, continue and pass.

Decision making and Branching / Conditional / if statements

If statement is a powerful decision-making statement and used to control the flow of execution of statements. Basically it is a two way decision statement and is used with a keyword if and test condition. It allows computer to evaluate the condition first and then, depending on the condition transfers the control to a particular statement. Python supports the following statements in order to achieve decision making capabilities

1.            If statement

2.            If –else

3.            Nested If

4.                 elif




1 comment: