Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Problem No 18

Evaluate Boolean Expressions

Medium

17 minute session

Summary

Use comparison and boolean operators to determine if three values are strictly increasing.

Problem statement

Given three numbers a, b, and c, return True if they are strictly increasing (a < b < c), otherwise return False. Use Python comparison chaining and boolean evaluation rather than multiple separate comparisons if possible. This helps practice comparisons, boolean results, and returning boolean values directly.

Task

Implement a function that evaluates a chained comparison (a < b < c) and returns the boolean result.

Examples

Strictly increasing

Input

is_strictly_increasing(1, 2, 3)

Output

True

Explanation

1 < 2 < 3 is True, so the function returns True.

Input format

Three numeric values a, b, c are passed as arguments to is_strictly_increasing.

Output format

Return a boolean: True if a < b < c, otherwise False.

Constraints

- Inputs can be integers or floats. - Use Python's comparison behavior; equal adjacent values should result in False.

Samples

Sample input 0

is_strictly_increasing(2, 2, 3)

Sample output 0

False

Explanation 0

Because 2 is not less than 2, the chained comparison fails.

Code editor
Loading editor…

AI assistant

Ask me anything!

Need help? I can explain the core idea behind this problem, review your current code, and give targeted hints. Use “Teach Theory” for the concept, “Get AI hint” for a quick scaffold nudge, or ask a specific question below.

Chat history is temporary and will not be saved.

03:40 AM

Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.