Lesson guide
What this Python exercise practices
Evaluate Boolean Expressions is a intermediate practice lesson that focuses on functions, parameters, return values. It is designed to be solved in about 17 minutes with examples, starter code, and test feedback.
Prerequisites
- Python variables
- Function parameters
- Return values
Difficulty and time
- Level
- Intermediate
- Estimated time
- 17 minutes
Practice path
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.
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.
Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.