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

Conditional Statement in Python

Python uses if statements for conditional execution based on whether a test expression is true or false. If statements can be nested within each other and used with else statements. If the test expression is true, the code block under if will execute, otherwise the else block will execute if present.

Uploaded by

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

Conditional Statement in Python

Python uses if statements for conditional execution based on whether a test expression is true or false. If statements can be nested within each other and used with else statements. If the test expression is true, the code block under if will execute, otherwise the else block will execute if present.

Uploaded by

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

Conditional statement in python

#if statement
Python if statement is used for decision- making operation conditional statement that
Tell a computer what to do with certain information.

Input Output

If else statement
Evaluates test expression and will execute the body of if only when the test condition is True.

Input Output

Input output

Input Output
IF- El if statement:
 IF- el if statement represent that if pervious condition is not true then try this
Condition

Input Output

Nested If-Else Statement:


A statement inside another statement.

Input

Out put

You might also like