easy +8 pts

Boolean from comparison chain

Evaluate chained comparisons, handle edge cases, and return the boolean result.

Write a function `evaluate_chain(a, b, c)` that returns the boolean result of the chained comparison `a < b < c`. The function must correctly handle cases where the chain is true or false, including cases where `a`, `b`, `c` are equal or when the comparison involves floating-point numbers. The function should use Python's native chained comparison behavior. Your implementation should not use any loops or conditionals—just directly return the expression.

Constraints

Inputs: `a`, `b`, `c` are numbers (integers or floats). The function must return a boolean. The chained comparison must be evaluated in a single expression. Complexity: O(1).

Example

>>> evaluate_chain(1, 2, 3)
True
>>> evaluate_chain(3, 2, 1)
False
>>> evaluate_chain(2, 2, 3)
False
>>> evaluate_chain(1.5, 2.5, 3.5)
True
8 points ~10 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Python allows chaining comparison operators directly.
The chain `a < b < c` is equivalent to `a < b and b < c`.
No need to handle exceptions; just return the boolean.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.