SlideShare a Scribd company logo
Learning Objectives
By the end of this lesson, you will be able to:
Describe expressions
Illustrate conditional statements
Explain loops
Describe functions
Conditional Statements and Functions
Conditional Expressions
Conditional expressions are used for comparison. Conditional statements supported by Python
are:
Equal
a==b
Not equal
a!=b
Less than
a<b
Less than or equal
a<=b
Greater than
a>b
Greater than or
equal
a>=b
Membership Expressions
Membership expressions are used to validate the membership of a value. It tests for
membership in a sequence, such as strings, lists, or tuples. The different membership
expressions in Python are:
Expression:
▪ Checks for equality
▪ Compares members
Conditional Statements
if, elif, else
Conditional statements execute a group of statements only based on some condition. In
Python, if ,elif, and else are the conditional keyword statements in use.
if: Executes a set of statements only if the condition is true otherwise, statement is
skipped.
Condition
Indentation
matters
if, elif, else
elif: elif or else if is to check multiple conditions.
else: If the condition is not true under if or elif, then the code jumps to else condition.
Jumps to
else
Loops
for Loop
Loops execute a group of statements as long as a condition is True. Python has two basic loops: for
loop and while loop.
for loop: This is also called iterative loop in Python. For loops can iterate over a sequence of
numbers using the "range" and "xrange" functions.
Range function to
set sequence limits
for iteration
Sequence Iteration Using for Loop
String
iteration
using for loop
List iteration
using for
loop
Tuple iteration
using for loop
Sequence IterationUsingfor Loop
dictionary
iteration using
for loop
Sets iteration
using for
loop
Sequence IterationUsingfor Loop
Sequence IterationUsingfor Loop
while Loop
while loop: while loops execute a set of statements as long as a condition is true.
Functions
Functions
A function is a block of code which only runs when it is called.
Defining
function
Passing
variables
Function
Call
Functions
A return statement ends the execution of the function call and returns the result. It is the value
of the expression following the return keyword to the caller.
In-Built Functions in Python
Python has a large library of in-built functions. Some of them are discussed here.
eval(): It evaluates the passed string as a Python expression and returns the result.
lamba(): helps to create one-line functions in Python.
In-Built Functions in Python
map() function returns a list of results after applying the given function to each item of a given
iterable.
• map(fun, iter) : Syntax
• fun : It is a function to which map passes each element of given iterable.
• iter : It is an iterable which is to be mapped.
• You can pass one or more iterable to the map() function.
In-Built Functions in Python
round() function rounds a number to give precision in decimal digits. If the number of decimal
places has not been specified, the decimal number is rounded off to a whole number.
Rounds number
to 2 decimal
places
In-Built Functions in Python
all() function returns false if any one of the elements of the iterable is zero and true if all the
elements of the iterable are nonzero.
Returns True
as non-zero
sequence
Returns False as
zero is present
in sequence
Knowledge Check
“a” is “apple”, will give output
as:
a. a
b. False
c. True
d. Will show error
Knowledge
Check
1
“a” is “apple”, will give output
as:
a. a
b. False
c. True
d. Will show error
Knowledge
Check
1
The correct answer is b
“is “ is a membership operator in Python which returns ‘True’ for exact
value.
a.
b.
Knowledge
Check
2
Let a=“XY“ then the expression: for i in
a:
print(a,end="t")
will give output
as:
X
Y
XY
X
Y
c. X
Y
d. XY
XY
a.
b.
Let a=“XY“ then the expression: for i in
a:
print(a,end="t")
will give output
as:
X
Y
XY
X
Y
c. X Y
d. XY
XY
Knowledge
Check
2
The correct answer is d
for loop will iterate the sequence two times and ends each iteration with a
tab.
Knowledge
Check
3
eval() function evaluates:
a. Expression passed as a string
b. Expression only if it contains digits
c. Expression containing digits and strings
d. Expression to sort the strings
eval() function evaluates:
Knowledge
Check
3
The correct answer is a
eval() evaluates the expression passed as a string and returns the
result.
a. Expression passed as a string
b. Expression only if it contains digits
c. Expression containing digits and strings
d. Expression to sort the strings
The output of: max(False,-4,-1)
a. -1
b. True
c. False
d. -4
Knowledge
Check
4
The output of: max(False,-4,-1)
a. -1
b. True
c. False
d. -4
Knowledge
Check
4
The correct answer is c
The function max() is being used to find the maximum value from -4, -1, and false. Since, false amounts to the
value zero, Hence, False is the right answer.
Key Takeaways
Conditional statements use conditional operators.
For loop is an iterative loop in Python.
Functions limit the use of loops.
Ad

Recommended

Unit - 2 CAP.pptx
Unit - 2 CAP.pptx
malekaanjum1
 
Control of flow of the phyton programming
Control of flow of the phyton programming
TriViccaWibisono
 
2 Python Basics II meeting 2 tunghai university pdf
2 Python Basics II meeting 2 tunghai university pdf
Anggi Andriyadi
 
ppt python notes list tuple data types ope
ppt python notes list tuple data types ope
SukhpreetSingh519414
 
Introduction to Python - Part Two
Introduction to Python - Part Two
amiable_indian
 
module 2.pptx
module 2.pptx
mahendranaik18
 
ControlStructures.pptx5t54t54444444444444444
ControlStructures.pptx5t54t54444444444444444
pawankamal3
 
Chapter - 3.pptx
Chapter - 3.pptx
MikialeTesfamariam
 
UNIT – 3.pptx for first year engineering
UNIT – 3.pptx for first year engineering
SabarigiriVason
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
DhivyaSubramaniyam
 
Learn more about the concepts of Data Types in Python
Learn more about the concepts of Data Types in Python
PrathamKandari
 
Python.pptx
Python.pptx
AKANSHAMITTAL2K21AFI
 
if else python.pdf
if else python.pdf
Gshs6
 
Python - Lecture 2
Python - Lecture 2
Ravi Kiran Khareedi
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
KalaiVani395886
 
Py-Slides-2.ppt
Py-Slides-2.ppt
TejaValmiki
 
Py-Slides-2.ppt
Py-Slides-2.ppt
AllanGuevarra1
 
Python Programming Module 3 (2).pdf
Python Programming Module 3 (2).pdf
Thanmayee S
 
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
PraveenaFppt
 
Chapter 2-Python and control flow statement.pptx
Chapter 2-Python and control flow statement.pptx
atharvdeshpande20
 
Control structures pyhton
Control structures pyhton
Prakash Jayaraman
 
Python unit 2 M.sc cs
Python unit 2 M.sc cs
KALAISELVI P
 
Python if_else_loop_Control_Flow_Statement
Python if_else_loop_Control_Flow_Statement
AbhishekGupta692777
 
python operators.ppt
python operators.ppt
ErnieAcuna
 
Python Flow Control & use of functions.pptx
Python Flow Control & use of functions.pptx
pandyahm47
 
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
Introduction to Python Basics
Introduction to Python Basics
Raghunath A
 
Python Revision Tour.pptx class 12 python notes
Python Revision Tour.pptx class 12 python notes
student164700
 
Web programming using python frameworks.
Web programming using python frameworks.
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Azure Fubdamentals (Az-900) presentation.
Azure Fubdamentals (Az-900) presentation.
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 

More Related Content

Similar to Python Conditional_Statements_and_Functions (20)

UNIT – 3.pptx for first year engineering
UNIT – 3.pptx for first year engineering
SabarigiriVason
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
DhivyaSubramaniyam
 
Learn more about the concepts of Data Types in Python
Learn more about the concepts of Data Types in Python
PrathamKandari
 
Python.pptx
Python.pptx
AKANSHAMITTAL2K21AFI
 
if else python.pdf
if else python.pdf
Gshs6
 
Python - Lecture 2
Python - Lecture 2
Ravi Kiran Khareedi
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
KalaiVani395886
 
Py-Slides-2.ppt
Py-Slides-2.ppt
TejaValmiki
 
Py-Slides-2.ppt
Py-Slides-2.ppt
AllanGuevarra1
 
Python Programming Module 3 (2).pdf
Python Programming Module 3 (2).pdf
Thanmayee S
 
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
PraveenaFppt
 
Chapter 2-Python and control flow statement.pptx
Chapter 2-Python and control flow statement.pptx
atharvdeshpande20
 
Control structures pyhton
Control structures pyhton
Prakash Jayaraman
 
Python unit 2 M.sc cs
Python unit 2 M.sc cs
KALAISELVI P
 
Python if_else_loop_Control_Flow_Statement
Python if_else_loop_Control_Flow_Statement
AbhishekGupta692777
 
python operators.ppt
python operators.ppt
ErnieAcuna
 
Python Flow Control & use of functions.pptx
Python Flow Control & use of functions.pptx
pandyahm47
 
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
Introduction to Python Basics
Introduction to Python Basics
Raghunath A
 
Python Revision Tour.pptx class 12 python notes
Python Revision Tour.pptx class 12 python notes
student164700
 
UNIT – 3.pptx for first year engineering
UNIT – 3.pptx for first year engineering
SabarigiriVason
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
DhivyaSubramaniyam
 
Learn more about the concepts of Data Types in Python
Learn more about the concepts of Data Types in Python
PrathamKandari
 
if else python.pdf
if else python.pdf
Gshs6
 
Python Programming Module 3 (2).pdf
Python Programming Module 3 (2).pdf
Thanmayee S
 
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
PraveenaFppt
 
Chapter 2-Python and control flow statement.pptx
Chapter 2-Python and control flow statement.pptx
atharvdeshpande20
 
Python unit 2 M.sc cs
Python unit 2 M.sc cs
KALAISELVI P
 
Python if_else_loop_Control_Flow_Statement
Python if_else_loop_Control_Flow_Statement
AbhishekGupta692777
 
python operators.ppt
python operators.ppt
ErnieAcuna
 
Python Flow Control & use of functions.pptx
Python Flow Control & use of functions.pptx
pandyahm47
 
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT - 2 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
Introduction to Python Basics
Introduction to Python Basics
Raghunath A
 
Python Revision Tour.pptx class 12 python notes
Python Revision Tour.pptx class 12 python notes
student164700
 

More from Puneet Kumar Bhatia (MBA, ITIL V3 Certified) (20)

Web programming using python frameworks.
Web programming using python frameworks.
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Azure Fubdamentals (Az-900) presentation.
Azure Fubdamentals (Az-900) presentation.
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Azure - Basic concepts and overview.pptx
Azure - Basic concepts and overview.pptx
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Cloud Computing basics - an overview.pptx
Cloud Computing basics - an overview.pptx
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Ansible as configuration management tool for devops
Ansible as configuration management tool for devops
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Microsoft Azure - Basic concepts presentation
Microsoft Azure - Basic concepts presentation
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Introduction to the Nexus tool for DevOps
Introduction to the Nexus tool for DevOps
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Introduction to Monitoring Tools for DevOps
Introduction to Monitoring Tools for DevOps
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Introduction to Monitoring Tools for DevOps
Introduction to Monitoring Tools for DevOps
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Introduction to Devops and its applications
Introduction to Devops and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Container Orchestration using kubernetes
Container Orchestration using kubernetes
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Java Microservices_64 Hours_Day wise plan (002).pdf
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Java Microservices_64 Hours_Day wise plan (002).pdf
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Aws interview questions
Aws interview questions
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Changing paradigm in job market
Changing paradigm in job market
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Kaizen08
Kaizen08
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Writing first-hudson-plugin
Writing first-hudson-plugin
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Ad

Recently uploaded (20)

Microsoft-365-Administrator-s-Guide1.pdf
Microsoft-365-Administrator-s-Guide1.pdf
mazharatknl
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Microsoft-365-Administrator-s-Guide1.pdf
Microsoft-365-Administrator-s-Guide1.pdf
mazharatknl
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Ad

Python Conditional_Statements_and_Functions

  • 1. Learning Objectives By the end of this lesson, you will be able to: Describe expressions Illustrate conditional statements Explain loops Describe functions
  • 3. Conditional Expressions Conditional expressions are used for comparison. Conditional statements supported by Python are: Equal a==b Not equal a!=b Less than a<b Less than or equal a<=b Greater than a>b Greater than or equal a>=b
  • 4. Membership Expressions Membership expressions are used to validate the membership of a value. It tests for membership in a sequence, such as strings, lists, or tuples. The different membership expressions in Python are: Expression: ▪ Checks for equality ▪ Compares members
  • 6. if, elif, else Conditional statements execute a group of statements only based on some condition. In Python, if ,elif, and else are the conditional keyword statements in use. if: Executes a set of statements only if the condition is true otherwise, statement is skipped. Condition Indentation matters
  • 7. if, elif, else elif: elif or else if is to check multiple conditions. else: If the condition is not true under if or elif, then the code jumps to else condition. Jumps to else
  • 9. for Loop Loops execute a group of statements as long as a condition is True. Python has two basic loops: for loop and while loop. for loop: This is also called iterative loop in Python. For loops can iterate over a sequence of numbers using the "range" and "xrange" functions. Range function to set sequence limits for iteration
  • 10. Sequence Iteration Using for Loop String iteration using for loop
  • 11. List iteration using for loop Tuple iteration using for loop Sequence IterationUsingfor Loop
  • 12. dictionary iteration using for loop Sets iteration using for loop Sequence IterationUsingfor Loop
  • 14. while Loop while loop: while loops execute a set of statements as long as a condition is true.
  • 16. Functions A function is a block of code which only runs when it is called. Defining function Passing variables Function Call
  • 17. Functions A return statement ends the execution of the function call and returns the result. It is the value of the expression following the return keyword to the caller.
  • 18. In-Built Functions in Python Python has a large library of in-built functions. Some of them are discussed here. eval(): It evaluates the passed string as a Python expression and returns the result. lamba(): helps to create one-line functions in Python.
  • 19. In-Built Functions in Python map() function returns a list of results after applying the given function to each item of a given iterable. • map(fun, iter) : Syntax • fun : It is a function to which map passes each element of given iterable. • iter : It is an iterable which is to be mapped. • You can pass one or more iterable to the map() function.
  • 20. In-Built Functions in Python round() function rounds a number to give precision in decimal digits. If the number of decimal places has not been specified, the decimal number is rounded off to a whole number. Rounds number to 2 decimal places
  • 21. In-Built Functions in Python all() function returns false if any one of the elements of the iterable is zero and true if all the elements of the iterable are nonzero. Returns True as non-zero sequence Returns False as zero is present in sequence
  • 23. “a” is “apple”, will give output as: a. a b. False c. True d. Will show error Knowledge Check 1
  • 24. “a” is “apple”, will give output as: a. a b. False c. True d. Will show error Knowledge Check 1 The correct answer is b “is “ is a membership operator in Python which returns ‘True’ for exact value.
  • 25. a. b. Knowledge Check 2 Let a=“XY“ then the expression: for i in a: print(a,end="t") will give output as: X Y XY X Y c. X Y d. XY XY
  • 26. a. b. Let a=“XY“ then the expression: for i in a: print(a,end="t") will give output as: X Y XY X Y c. X Y d. XY XY Knowledge Check 2 The correct answer is d for loop will iterate the sequence two times and ends each iteration with a tab.
  • 27. Knowledge Check 3 eval() function evaluates: a. Expression passed as a string b. Expression only if it contains digits c. Expression containing digits and strings d. Expression to sort the strings
  • 28. eval() function evaluates: Knowledge Check 3 The correct answer is a eval() evaluates the expression passed as a string and returns the result. a. Expression passed as a string b. Expression only if it contains digits c. Expression containing digits and strings d. Expression to sort the strings
  • 29. The output of: max(False,-4,-1) a. -1 b. True c. False d. -4 Knowledge Check 4
  • 30. The output of: max(False,-4,-1) a. -1 b. True c. False d. -4 Knowledge Check 4 The correct answer is c The function max() is being used to find the maximum value from -4, -1, and false. Since, false amounts to the value zero, Hence, False is the right answer.
  • 31. Key Takeaways Conditional statements use conditional operators. For loop is an iterative loop in Python. Functions limit the use of loops.