0% found this document useful (0 votes)
6 views6 pages

Slide 1: Decision Making Statements

PYTHON PGRRCDE UNIT 2

Uploaded by

tasya lopa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Slide 1: Decision Making Statements

PYTHON PGRRCDE UNIT 2

Uploaded by

tasya lopa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Slide 1: Decision Making Statements

Title: Decision Making Statements


Subtitle: Objectives and Contents

Slide 2: Objectives

Title: Objectives
Subtitle: To familiarize with
Content:
Definition of decision making
If statement
If and else statement
Elif statement
Nested if statements

Slide 3: Decision Making Statements

Title: Decision Making Statements


Subtitle:
Content:
Decision-making is the anticipation of conditions occurring during
the execution of a program and specified actions taken according to
the conditions.
Decision structures evaluate multiple expressions, which produce
TRUE or FALSE as the outcome.
You need to determine which action to take and which statements to
execute if the outcome is TRUE or FALSE otherwise.

Slide 4: Decision Making Statements (cont.)

Title: Decision Making Statements


Subtitle:
Content:
Python programming language assumes any non-zero and non-null
values as TRUE, and any zero or null values as FALSE value.
Python programming language provides the following types of
decision-making statements.

Slide 5: if Statement

Title: if Statement
Subtitle:
Content:
The IF statement is similar to that of other languages.
The if statement contains a logical expression using which the data
is compared and a decision is made based on the result of the
comparison.

Slide 6: if Statement Syntax

Title: if Statement
Subtitle: Syntax
Content:
if expression:
statement(s)
If the boolean expression evaluates to TRUE, then the block of
statement(s) inside the if statement is executed.

Slide 7: if Statement Flow Diagram

Title: if Statement
Subtitle: Flow Diagram
Content:
You can use one if or else if statement inside another if or else if
statement(s).

Slide 8: Example of if Statement

Title: if Statement
Subtitle: Example
Content:
Example code demonstrating the use of if statement in Python.

Slide 9: if...else Statement

Title: if...else Statement


Subtitle:
Content:
An else statement can be combined with an if statement.
The else statement contains a block of code that executes if the
conditional expression in the if statement resolves to 0 or a FALSE
value.

Slide 10: if...else Statement Syntax

Title: if...else Statement


Subtitle: Syntax
Content:
The syntax of the if...else statement.

Slide 11: if...else Statement Flow Diagram

Title: if...else Statement


Subtitle: Flow Diagram
Content:
Diagram illustrating the flow of an if...else statement.

Slide 12: Example of if...else Statement

Title: if...else Statement


Subtitle: Example
Content:
Example code demonstrating the use of if...else statement in
Python.

Slide 13: if...elif...else Statement


Title: if...elif...else Statement
Subtitle:
Content:
The elif statement allows you to check multiple expressions for TRUE
and execute a block of code as soon as one of the conditions
evaluates to TRUE.

Slide 14: if...elif...else Statement Syntax

Title: if...elif...else Statement


Subtitle: Syntax
Content:
The syntax of the if...elif...else statement.

Slide 15: Example of if...elif...else Statement

Title: if...elif...else Statement


Subtitle: Example
Content:
Example code demonstrating the use of if...elif...else statement in
Python.

Slide 16: Nested IF Statements

Title: Nested IF Statements


Subtitle:
Content:
Explaining the use of nested if statements in Python.

Slide 17: Nested IF Statements Syntax

Title: Nested IF Statements


Subtitle: Syntax
Content:
The syntax of the nested if...elif...else construct.

Slide 18: Example of Nested IF Statements

Title: Nested IF Statements


Subtitle: Example
Content:
Example code demonstrating the use of nested if statements in
Python.

You might also like