Course Content
Introduction to Python
3. Conditional Statements
Introduction to Python
Challenge: Odd and Even
Let's tackle another practice task!
Task
You're provided with a number labeled num
. Using if
/else
, display the message:
"The number num is odd"
ifnum
is odd."The number num is even"
ifnum
is even.
In the print()
functions, fill in the ___
with the appropriate descriptor ('odd'
or 'even'
).
Tip: A number is considered even if, when divided by 2
, the remainder (using the %
operator) is 0
.
Everything was clear?
Section 3. Chapter 8