
Learning outcomes
By the end of this chapter, you should be able to:- apply arithmetic operators
- write relational expressions
- evaluate logical expressions
- understand precedence basics
Expression
An expression is a combination of values, variables, and operators that evaluates to a result.Arithmetic operators
+, -, *, /, //, %, **
Relational operators
==, !=, >, <, >=, <=
Logical operators
and, or, not
Operator precedence (basic)
()**- unary
+,-,not *,/,//,%+,-- relational operators
andor
Exam-focused points
/always returns float//is floor division%gives remainder- logical operators return boolean result in standard comparisons
Practice questions
- Evaluate manually, then verify in Python:
- Write expression to check if a number is between 10 and 50.
- Write condition for pass: marks >= 40 and attendance >= 75.
