Курси /
Introduction to Python
Challenge
Завдання
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.
Все було зрозуміло?
Секція 6. Розділ 6
Зміст курсу
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
Introduction to Python
Challenge
Завдання
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.
Все було зрозуміло?
Секція 6. Розділ 6