An expression can be evaluated to return a value. Any expression can also be used as an operator.
In other words, if you can write a = ... , then ... is an expression. So 2*3 and zip(x,y) are expressions.
Something like raise Exception is an expression, but not an expression: you cannot write a = (raise Exception) .
yield is an expression meaning that b = (yield a) is valid code in the generator. If you use the send() generator method, b set to the value you are passing.
source share