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

Conditional Satetements, 50729

The document discusses different types of conditional statements in Python including if, if-else, if-elif statements and nested if statements. It provides the syntax and explanation of each statement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Conditional Satetements, 50729

The document discusses different types of conditional statements in Python including if, if-else, if-elif statements and nested if statements. It provides the syntax and explanation of each statement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

NAME : SAI SANTOSH K

CLASS : III-B
ROLL NO:50729
SUBJECT :PYTHON
C O N D I T I O N A L S TAT E M E N T S

A conditional is a statement set which is executed,


on the basis of result of a condition
C O N D I T I O N A L S TAT E M E N T
o IF STATEMENT

o IF ELSE STATEMENT

o IF ELIF STATEMENT

o NESTED IF STATEMENT
I F - S TAT E M E N T
if the condition evaluates to True, a statement or set of statements is
executed. If the condition is False, it does nothing.

Syntax:
if <conditional statements>:
statement
[statements]
else:
statement
[statements]
I F - E L S E S TAT E M E N T
Tests a condition and if the condition evaluates to True, it carries out
statements indented below if, and in case condition evaluates to False,
it carries out statements indented below else.
Syntax :
if <conditional expression>:
statement
[statements]
else:
statement
[statements]
I F - E L I F S TAT E M E N T
A multi-way decision control statement that allows the programmer to choose one of
several possible alternatives by checking multiple conditions / expressions and executes
a set of code as soon as one that condition evaluates to True. Like else, elif statement
is also optional.
Syntax:
if <conditional expression>:
statement
[statements]
elif <conditional expression>:
statement
[statements]
else:
statement [statements]
NESTED IF STATEMENTS
A nested if is an if that has another if in its if’s body or in
elif’s body or in its else’s body
Syntax:
If(condition1)
If(condition2)
Statement1;
else:
statement2;
else:
if(condition3)
statement3;
else
statement4;
THANK YOU

You might also like