0% found this document useful (0 votes)
38 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 condition for an if statement is false, the else block will execute. Nested if statements allow for multiple conditions to be checked in sequence.

Uploaded by

Sana Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 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 condition for an if statement is false, the else block will execute. Nested if statements allow for multiple conditions to be checked in sequence.

Uploaded by

Sana Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, 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