Expressions in Python


☞It is any valid combination of operators and operands that represents a value.

☞It is composed of one or more operations.

Examples : 15, 2.4, a+12, x>y, 3+4>4-6, x = 8 etc.


lvalues & rvalues

lvalues are the objects to which you can assign a value or expression. They come on the LHS ( Left Hand Side ) of an assignment statement.

rvalues are the literals and expressions that are assigned to Lvalues. They come on the RHS ( Right Hand Side ) of an assignment statement.

Example : x = 8 ( x is Lvalue whereas 8 is Rvalue )

Some invalid expressions : 20 = a; 10 * 5 = c, etc