Introduction to Programming
and
Decision-Making Statements
in Python
CONTENTS
oBasics of Programming
oIntroduction to Python
oDecision Making
oDecision Making statements in Python
oSummary and Take aways
oReferences
2
Learning Objectives
1. Introduce programming and use cases in business technology domain.
2. Understand the the different decision making statements and its flow of logic.
3. Demonstrate examples on decision making statements in Python.
3
Basics of Programming
❑ A process of performing computational tasks to solve problems.
❑ Its not a herculean task !
❑ Myth: Programming is only for Computer Engineers!
❑ Bit of syntax and bit of logic
❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic!
Any examples?
C, C++, Java, Python etc.
4
5
Introduction to Python
It is used for:
• web development
• software development,
• solving mathematical problems,
• business analytics problems
Why Python?
• Python works on different platforms (Windows, Mac, Linux, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows to write programs with fewer lines than some other programming
languages.
• Python runs on an interpreter system, meaning that code can be executed as soon as it is written.
6
Introduction to Python
Python 3 – current version
Where you write python programs?
→Any text editors or any IDE
→Save file as <filename>.py
7
If you want to display something on your screen,
print("Hello, World!") ➔ Hello, World!
(remember the quotes “ ” when you pass strings/text)
a = 100
print(a)
➔ ?
print("a") ➔ a
8
Introduction to Python
Decision Making
There comes a point in your life where you need to decide what steps should be
taken and based on that you decide your next decisions.
Any examples?
In programming, we often have this similar situation where we need to decide which
block of code should be executed based on a condition.
Example: Movements of Mario
9
Decision making statements in Python
▪ if statements
▪ if-else statements
▪ if-elif ladder
10
if statement
• Most simple form of decision-making statement.
• It takes an expression and checks if the expression evaluates to True then the
block of code (body) in if statement will be executed.
• If the expression evaluates to False, then the block of code is skipped.
if (expression):
Statement body
Statement z
11
a=20
if (a = 20):
print (a)
print (“end”)
Output
20
expression
body
Indenting the
body is
mandatory!
Example program
a = 20 ; b = 20
if ( a == b ):
print( “a and b are equal”)
print(“If block ended”)
Output
a and b are equal
If block ended
12
Allowable Relational Operators for Boolean Expressions
if (operand relational operator operand) then
Ex: if (a == b)
Python Mathematical
operator equivalent Meaning Example
< < Less than 5 < 3
> > Greater than 5 > 3
== = Equal to 5 == 3
<= ≤ Less than or equal to 5 <= 5
>= ≥ Greater than or equal to 5 >= 4
!= ≠ Not equal to 5 != 5
if-else statement
• checks the expression and executes the if block when the expression is True
otherwise it will execute the else block of code.
if (expression):
Statement
else:
Statement
14
Program
weather = "rainy"
if (weather == "sunny"):
print("It's a beautiful day! I will go outside.")
else:
print("It's not sunny today. I will stay indoors.")
Output
It's not sunny today. I will stay indoors.
Example program
number1 = 20 ; number2 = 30
if( number1 >= number2 ):
print(“number 1 is greater than number 2”)
else:
print(“number 2 is greater than number 1”)
Output
number 2 is greater than number 1
15
1
2
3
if-elif ladder
• elif keyword to chain multiple conditions one after another.
• helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates
to True.
if( expression1 ):
statement
elif (expression2 ) :
statement
elif(expression3 ):
statement
.
.
else:
statement
16
Example program
score = 85
if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
else:
grade = "F"
print("The student's grade is:", grade)
Output
The student’s grade is: B
17
Summary and Key Takeaways
• Decision-making with conditional statements is a fundamental programming
concept.
• "if," "if-else," and "if-elif-else" statements enable different decision paths in
programs.
• Conditional statements are powerful tools for automating tasks and making
informed business decisions.
18
INTRODUCTION TO
PROGRAMMING
AND
DECISION-MAKING
STATEMENTS
IN PYTHON
CONTENTS
oBasics of Programming
oIntroduction to Python
oDecision Making
oDecision Making statements in Python
oSummary and Take aways
oReferences
21
LEARNING OBJECTIVES
1. Introduce programming and use cases in business technology domain.
2. Understand the the different decision making statements and its flow of logic.
3. Demonstrate examples on decision making statements in Python.
22
BASICS OF PROGRAMMING
❑ A process of performing computational tasks to solve problems.
❑ Its not a herculean task !
❑ Myth: Programming is only for Computer Engineers!
❑ Bit of syntax and bit of logic
❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic!
Any examples?
C, C++, Java, Python etc.
23
24
INTRODUCTION TO PYTHON
It is used for:
• web development
• software development,
• solving mathematical problems,
• business analytics problems
Why Python?
• Python works on different platforms (Windows, Mac, Linux, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows to write programs with fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be executed as soon as it is written.
25
INTRODUCTION TO PYTHON
Python 3 – current version
Where you write python programs?
→Any text editors or any IDE
→Save file as <filename>.py
26
If you want to display something on your screen,
print("Hello, World!") ➔ Hello, World!
(remember the quotes “ ” when you pass strings/text)
a = 100
print(a)
➔ ?
print("a") ➔ a
27
INTRODUCTION TO PYTHON
DECISION MAKING
There comes a point in your life where you need to decide what steps should be taken
and based on that you decide your next decisions.
Any examples?
In programming, we often have this similar situation where we need to decide which
block of code should be executed based on a condition.
Example: Movements of Mario
28
DECISION MAKING STATEMENTS IN PYTHON
▪ if statements
▪ if-else statements
▪ if-elif ladder
29
IF STATEMENT
• Most simple form of decision-making statement.
• It takes an expression and checks if the expression evaluates to True then the
block of code (body) in if statement will be executed.
• If the expression evaluates to False, then the block of code is skipped.
if (expression):
Statement body
Statement z
30
a=20
if (a = 20):
print (a)
print (“end”)
Output
20
expression
body
Indenting the
body is
mandatory!
Example program
a = 20 ; b = 20
if ( a == b ):
print( “a and b are equal”)
print(“If block ended”)
Output
a and b are equal
If block ended
31
ALLOWABLE RELATIONAL OPERATORS FOR
BOOLEAN EXPRESSIONS
if (operand relational operator operand) then
Ex: if (a == b)
Python Mathematical
operator equivalent Meaning Example
< < Less than 5 < 3
> > Greater than 5 > 3
== = Equal to 5 == 3
<= ≤ Less than or equal to 5 <= 5
>= ≥ Greater than or equal to 5 >= 4
!= ≠ Not equal to 5 != 5
IF-ELSE STATEMENT
• checks the expression and executes the if block when the expression is True
otherwise it will execute the else block of code.
if (expression):
Statement
else:
Statement
33
Program
weather = "rainy"
if (weather == "sunny"):
print("It's a beautiful day! I will go outside.")
else:
print("It's not sunny today. I will stay indoors.")
Output
It's not sunny today. I will stay indoors.
Example program
number1 = 20 ; number2 = 30
if( number1 >= number2 ):
print(“number 1 is greater than number 2”)
else:
print(“number 2 is greater than number 1”)
Output
number 2 is greater than number 1
34
1
2
3
IF-ELIF LADDER
• elif keyword to chain multiple conditions one after another.
• helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates to True.
if( expression1 ):
statement
elif (expression2 ) :
statement
elif(expression3 ):
statement
.
.
else:
statement
35
Example program
score = 85
if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
else:
grade = "F"
print("The student's grade is:", grade)
Output
The student’s grade is: B
36
SUMMARY AND KEY TAKEAWAYS
• Decision-making with conditional statements is a fundamental programming
concept.
• "if," "if-else," and "if-elif-else" statements enable different decision paths in
programs.
• Conditional statements are powerful tools for automating tasks and making
informed business decisions.
37
INTRODUCTION TO
PROGRAMMING
AND
DECISION-MAKING
STATEMENTS
IN PYTHON
CONTENTS
oBasics of Programming
oIntroduction to Python
oDecision Making
oDecision Making statements in Python
oSummary and Take aways
oReferences
40
LEARNING OBJECTIVES
1. Introduce programming and use cases in business technology domain.
2. Understand the the different decision making statements and its flow of logic.
3. Demonstrate examples on decision making statements in Python.
41
BASICS OF PROGRAMMING
❑ A process of performing computational tasks to solve problems.
❑ Its not a herculean task !
❑ Myth: Programming is only for Computer Engineers!
❑ Bit of syntax and bit of logic
❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic!
Any examples?
C, C++, Java, Python etc.
42
43
INTRODUCTION TO PYTHON
It is used for:
• web development
• software development,
• solving mathematical problems,
• business analytics problems
Why Python?
• Python works on different platforms (Windows, Mac, Linux, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows to write programs with fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be executed as soon as it is written.
44
INTRODUCTION TO PYTHON
Python 3 – current version
Where you write python programs?
→Any text editors or any IDE
→Save file as <filename>.py
45
If you want to display something on your screen,
print("Hello, World!") ➔ Hello, World!
(remember the quotes “ ” when you pass strings/text)
a = 100
print(a)
➔ ?
print("a") ➔ a
46
INTRODUCTION TO PYTHON
DECISION MAKING
There comes a point in your life where you need to decide what steps should be taken
and based on that you decide your next decisions.
Any examples?
In programming, we often have this similar situation where we need to decide which
block of code should be executed based on a condition.
Example: Movements of Mario
47
DECISION MAKING STATEMENTS IN PYTHON
▪ if statements
▪ if-else statements
▪ if-elif ladder
48
IF STATEMENT
• Most simple form of decision-making statement.
• It takes an expression and checks if the expression evaluates to True then the
block of code (body) in if statement will be executed.
• If the expression evaluates to False, then the block of code is skipped.
if (expression):
Statement body
Statement z
49
a=20
if (a = 20):
print (a)
print (“end”)
Output
20
expression
body
Indenting the
body is
mandatory!
Example program
a = 20 ; b = 20
if ( a == b ):
print( “a and b are equal”)
print(“If block ended”)
Output
a and b are equal
If block ended
50
ALLOWABLE RELATIONAL OPERATORS FOR
BOOLEAN EXPRESSIONS
if (operand relational operator operand) then
Ex: if (a == b)
Python Mathematical
operator equivalent Meaning Example
< < Less than 5 < 3
> > Greater than 5 > 3
== = Equal to 5 == 3
<= ≤ Less than or equal to 5 <= 5
>= ≥ Greater than or equal to 5 >= 4
!= ≠ Not equal to 5 != 5
IF-ELSE STATEMENT
• checks the expression and executes the if block when the expression is True
otherwise it will execute the else block of code.
if (expression):
Statement
else:
Statement
52
Program
weather = "rainy"
if (weather == "sunny"):
print("It's a beautiful day! I will go outside.")
else:
print("It's not sunny today. I will stay indoors.")
Output
It's not sunny today. I will stay indoors.
Example program
number1 = 20 ; number2 = 30
if( number1 >= number2 ):
print(“number 1 is greater than number 2”)
else:
print(“number 2 is greater than number 1”)
Output
number 2 is greater than number 1
53
1
2
3
IF-ELIF LADDER
• elif keyword to chain multiple conditions one after another.
• helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates to True.
if( expression1 ):
statement
elif (expression2 ) :
statement
elif(expression3 ):
statement
.
.
else:
statement
54
Example program
score = 85
if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
else:
grade = "F"
print("The student's grade is:", grade)
Output
The student’s grade is: B
55
SUMMARY AND KEY TAKEAWAYS
• Decision-making with conditional statements is a fundamental programming
concept.
• "if," "if-else," and "if-elif-else" statements enable different decision paths in
programs.
• Conditional statements are powerful tools for automating tasks and making
informed business decisions.
56
if statements in Python -A lecture class

if statements in Python -A lecture class

  • 1.
  • 2.
    CONTENTS oBasics of Programming oIntroductionto Python oDecision Making oDecision Making statements in Python oSummary and Take aways oReferences 2
  • 3.
    Learning Objectives 1. Introduceprogramming and use cases in business technology domain. 2. Understand the the different decision making statements and its flow of logic. 3. Demonstrate examples on decision making statements in Python. 3
  • 4.
    Basics of Programming ❑A process of performing computational tasks to solve problems. ❑ Its not a herculean task ! ❑ Myth: Programming is only for Computer Engineers! ❑ Bit of syntax and bit of logic ❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic! Any examples? C, C++, Java, Python etc. 4
  • 5.
  • 6.
    Introduction to Python Itis used for: • web development • software development, • solving mathematical problems, • business analytics problems Why Python? • Python works on different platforms (Windows, Mac, Linux, etc). • Python has a simple syntax similar to the English language. • Python has syntax that allows to write programs with fewer lines than some other programming languages. • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. 6
  • 7.
    Introduction to Python Python3 – current version Where you write python programs? →Any text editors or any IDE →Save file as <filename>.py 7
  • 8.
    If you wantto display something on your screen, print("Hello, World!") ➔ Hello, World! (remember the quotes “ ” when you pass strings/text) a = 100 print(a) ➔ ? print("a") ➔ a 8 Introduction to Python
  • 9.
    Decision Making There comesa point in your life where you need to decide what steps should be taken and based on that you decide your next decisions. Any examples? In programming, we often have this similar situation where we need to decide which block of code should be executed based on a condition. Example: Movements of Mario 9
  • 10.
    Decision making statementsin Python ▪ if statements ▪ if-else statements ▪ if-elif ladder 10
  • 11.
    if statement • Mostsimple form of decision-making statement. • It takes an expression and checks if the expression evaluates to True then the block of code (body) in if statement will be executed. • If the expression evaluates to False, then the block of code is skipped. if (expression): Statement body Statement z 11 a=20 if (a = 20): print (a) print (“end”) Output 20 expression body Indenting the body is mandatory!
  • 12.
    Example program a =20 ; b = 20 if ( a == b ): print( “a and b are equal”) print(“If block ended”) Output a and b are equal If block ended 12
  • 13.
    Allowable Relational Operatorsfor Boolean Expressions if (operand relational operator operand) then Ex: if (a == b) Python Mathematical operator equivalent Meaning Example < < Less than 5 < 3 > > Greater than 5 > 3 == = Equal to 5 == 3 <= ≤ Less than or equal to 5 <= 5 >= ≥ Greater than or equal to 5 >= 4 != ≠ Not equal to 5 != 5
  • 14.
    if-else statement • checksthe expression and executes the if block when the expression is True otherwise it will execute the else block of code. if (expression): Statement else: Statement 14 Program weather = "rainy" if (weather == "sunny"): print("It's a beautiful day! I will go outside.") else: print("It's not sunny today. I will stay indoors.") Output It's not sunny today. I will stay indoors.
  • 15.
    Example program number1 =20 ; number2 = 30 if( number1 >= number2 ): print(“number 1 is greater than number 2”) else: print(“number 2 is greater than number 1”) Output number 2 is greater than number 1 15 1 2 3
  • 16.
    if-elif ladder • elifkeyword to chain multiple conditions one after another. • helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates to True. if( expression1 ): statement elif (expression2 ) : statement elif(expression3 ): statement . . else: statement 16
  • 17.
    Example program score =85 if score >= 90: grade = "A" elif score >= 80: grade = "B" elif score >= 70: grade = "C" else: grade = "F" print("The student's grade is:", grade) Output The student’s grade is: B 17
  • 18.
    Summary and KeyTakeaways • Decision-making with conditional statements is a fundamental programming concept. • "if," "if-else," and "if-elif-else" statements enable different decision paths in programs. • Conditional statements are powerful tools for automating tasks and making informed business decisions. 18
  • 20.
  • 21.
    CONTENTS oBasics of Programming oIntroductionto Python oDecision Making oDecision Making statements in Python oSummary and Take aways oReferences 21
  • 22.
    LEARNING OBJECTIVES 1. Introduceprogramming and use cases in business technology domain. 2. Understand the the different decision making statements and its flow of logic. 3. Demonstrate examples on decision making statements in Python. 22
  • 23.
    BASICS OF PROGRAMMING ❑A process of performing computational tasks to solve problems. ❑ Its not a herculean task ! ❑ Myth: Programming is only for Computer Engineers! ❑ Bit of syntax and bit of logic ❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic! Any examples? C, C++, Java, Python etc. 23
  • 24.
  • 25.
    INTRODUCTION TO PYTHON Itis used for: • web development • software development, • solving mathematical problems, • business analytics problems Why Python? • Python works on different platforms (Windows, Mac, Linux, etc). • Python has a simple syntax similar to the English language. • Python has syntax that allows to write programs with fewer lines than some other programming languages. • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. 25
  • 26.
    INTRODUCTION TO PYTHON Python3 – current version Where you write python programs? →Any text editors or any IDE →Save file as <filename>.py 26
  • 27.
    If you wantto display something on your screen, print("Hello, World!") ➔ Hello, World! (remember the quotes “ ” when you pass strings/text) a = 100 print(a) ➔ ? print("a") ➔ a 27 INTRODUCTION TO PYTHON
  • 28.
    DECISION MAKING There comesa point in your life where you need to decide what steps should be taken and based on that you decide your next decisions. Any examples? In programming, we often have this similar situation where we need to decide which block of code should be executed based on a condition. Example: Movements of Mario 28
  • 29.
    DECISION MAKING STATEMENTSIN PYTHON ▪ if statements ▪ if-else statements ▪ if-elif ladder 29
  • 30.
    IF STATEMENT • Mostsimple form of decision-making statement. • It takes an expression and checks if the expression evaluates to True then the block of code (body) in if statement will be executed. • If the expression evaluates to False, then the block of code is skipped. if (expression): Statement body Statement z 30 a=20 if (a = 20): print (a) print (“end”) Output 20 expression body Indenting the body is mandatory!
  • 31.
    Example program a =20 ; b = 20 if ( a == b ): print( “a and b are equal”) print(“If block ended”) Output a and b are equal If block ended 31
  • 32.
    ALLOWABLE RELATIONAL OPERATORSFOR BOOLEAN EXPRESSIONS if (operand relational operator operand) then Ex: if (a == b) Python Mathematical operator equivalent Meaning Example < < Less than 5 < 3 > > Greater than 5 > 3 == = Equal to 5 == 3 <= ≤ Less than or equal to 5 <= 5 >= ≥ Greater than or equal to 5 >= 4 != ≠ Not equal to 5 != 5
  • 33.
    IF-ELSE STATEMENT • checksthe expression and executes the if block when the expression is True otherwise it will execute the else block of code. if (expression): Statement else: Statement 33 Program weather = "rainy" if (weather == "sunny"): print("It's a beautiful day! I will go outside.") else: print("It's not sunny today. I will stay indoors.") Output It's not sunny today. I will stay indoors.
  • 34.
    Example program number1 =20 ; number2 = 30 if( number1 >= number2 ): print(“number 1 is greater than number 2”) else: print(“number 2 is greater than number 1”) Output number 2 is greater than number 1 34 1 2 3
  • 35.
    IF-ELIF LADDER • elifkeyword to chain multiple conditions one after another. • helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates to True. if( expression1 ): statement elif (expression2 ) : statement elif(expression3 ): statement . . else: statement 35
  • 36.
    Example program score =85 if score >= 90: grade = "A" elif score >= 80: grade = "B" elif score >= 70: grade = "C" else: grade = "F" print("The student's grade is:", grade) Output The student’s grade is: B 36
  • 37.
    SUMMARY AND KEYTAKEAWAYS • Decision-making with conditional statements is a fundamental programming concept. • "if," "if-else," and "if-elif-else" statements enable different decision paths in programs. • Conditional statements are powerful tools for automating tasks and making informed business decisions. 37
  • 39.
  • 40.
    CONTENTS oBasics of Programming oIntroductionto Python oDecision Making oDecision Making statements in Python oSummary and Take aways oReferences 40
  • 41.
    LEARNING OBJECTIVES 1. Introduceprogramming and use cases in business technology domain. 2. Understand the the different decision making statements and its flow of logic. 3. Demonstrate examples on decision making statements in Python. 41
  • 42.
    BASICS OF PROGRAMMING ❑A process of performing computational tasks to solve problems. ❑ Its not a herculean task ! ❑ Myth: Programming is only for Computer Engineers! ❑ Bit of syntax and bit of logic ❑ Programming Language: A set of rules/syntax helps you to solve a problem with a logic! Any examples? C, C++, Java, Python etc. 42
  • 43.
  • 44.
    INTRODUCTION TO PYTHON Itis used for: • web development • software development, • solving mathematical problems, • business analytics problems Why Python? • Python works on different platforms (Windows, Mac, Linux, etc). • Python has a simple syntax similar to the English language. • Python has syntax that allows to write programs with fewer lines than some other programming languages. • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. 44
  • 45.
    INTRODUCTION TO PYTHON Python3 – current version Where you write python programs? →Any text editors or any IDE →Save file as <filename>.py 45
  • 46.
    If you wantto display something on your screen, print("Hello, World!") ➔ Hello, World! (remember the quotes “ ” when you pass strings/text) a = 100 print(a) ➔ ? print("a") ➔ a 46 INTRODUCTION TO PYTHON
  • 47.
    DECISION MAKING There comesa point in your life where you need to decide what steps should be taken and based on that you decide your next decisions. Any examples? In programming, we often have this similar situation where we need to decide which block of code should be executed based on a condition. Example: Movements of Mario 47
  • 48.
    DECISION MAKING STATEMENTSIN PYTHON ▪ if statements ▪ if-else statements ▪ if-elif ladder 48
  • 49.
    IF STATEMENT • Mostsimple form of decision-making statement. • It takes an expression and checks if the expression evaluates to True then the block of code (body) in if statement will be executed. • If the expression evaluates to False, then the block of code is skipped. if (expression): Statement body Statement z 49 a=20 if (a = 20): print (a) print (“end”) Output 20 expression body Indenting the body is mandatory!
  • 50.
    Example program a =20 ; b = 20 if ( a == b ): print( “a and b are equal”) print(“If block ended”) Output a and b are equal If block ended 50
  • 51.
    ALLOWABLE RELATIONAL OPERATORSFOR BOOLEAN EXPRESSIONS if (operand relational operator operand) then Ex: if (a == b) Python Mathematical operator equivalent Meaning Example < < Less than 5 < 3 > > Greater than 5 > 3 == = Equal to 5 == 3 <= ≤ Less than or equal to 5 <= 5 >= ≥ Greater than or equal to 5 >= 4 != ≠ Not equal to 5 != 5
  • 52.
    IF-ELSE STATEMENT • checksthe expression and executes the if block when the expression is True otherwise it will execute the else block of code. if (expression): Statement else: Statement 52 Program weather = "rainy" if (weather == "sunny"): print("It's a beautiful day! I will go outside.") else: print("It's not sunny today. I will stay indoors.") Output It's not sunny today. I will stay indoors.
  • 53.
    Example program number1 =20 ; number2 = 30 if( number1 >= number2 ): print(“number 1 is greater than number 2”) else: print(“number 2 is greater than number 1”) Output number 2 is greater than number 1 53 1 2 3
  • 54.
    IF-ELIF LADDER • elifkeyword to chain multiple conditions one after another. • helps to check multiple expressions and it executes the code as soon as one of the conditions evaluates to True. if( expression1 ): statement elif (expression2 ) : statement elif(expression3 ): statement . . else: statement 54
  • 55.
    Example program score =85 if score >= 90: grade = "A" elif score >= 80: grade = "B" elif score >= 70: grade = "C" else: grade = "F" print("The student's grade is:", grade) Output The student’s grade is: B 55
  • 56.
    SUMMARY AND KEYTAKEAWAYS • Decision-making with conditional statements is a fundamental programming concept. • "if," "if-else," and "if-elif-else" statements enable different decision paths in programs. • Conditional statements are powerful tools for automating tasks and making informed business decisions. 56