Course Content
Introduction to Python
Introduction to Python
3. Conditional Statements
Boolean Data TypeChallenge: Comparison OperatorsCombining ConditionsChallenge: Logical OperatorsMembership Operators and Types ComparisonSimple if/else ExpressionsChallenge: Grocery StoreChallenge: Odd and Evenif/elif/else ExpressionsChallenge: Grocery Store ExtendedChallenge: Positive, Negative or Zero
Challenge
Task
Swipe to show code editor
Your task is to create a function called is_positive
that takes in a single argument, n
. It should return:
'positive'
ifn
is greater than0
.'negative'
ifn
is less than0
.'zero'
ifn
is equal to zero.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 6
Challenge
Task
Swipe to show code editor
Your task is to create a function called is_positive
that takes in a single argument, n
. It should return:
'positive'
ifn
is greater than0
.'negative'
ifn
is less than0
.'zero'
ifn
is equal to zero.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 6
Switch to desktop for real-world practiceContinue from where you are using one of the options below