Evaluate the expressions below:
Evaluate the expressions below:
Expressions with comparisons operators are evaluated to True
or False
==
equal!=
different>=
greater or equal>
greater<=
less or equal<
lessWrite a function called odd
that takes one integer argument n
and returns True
if n
is odd, False
if n
is even
Submit your odd.py
file to attendance on Gradescope
Expressions with comparisons operators are evaluated to True
or False
==
equal!=
different>=
greater or equal>
greater<=
less or equal<
lessExpression | Result |
---|---|
not True | False |
not False | True |
Expression | Result |
---|---|
True and True | True |
False and True | False |
True and False | False |
False and False | False |
Expression | Result |
---|---|
True or True | True |
False or True | True |
True or False | True |
False or False | False |
(expressions...)
**
: Exponentiation
*, /, //, %
: Multiplication, Division, Floor Division and Remainder
+, -
: Addition and subtraction
<, <=, >, >=, !=, ==
: Comparisons
not x
: Boolean NOT
and
: Boolean AND
or
: Boolean OR