We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

Expression statements

An expression statement is simply an expression or an expression list, used as a statement.


expression list

Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a procedure (a function that returns no meaningful result; in Python, procedures return the value None). Other uses of expression statements are allowed and occasionally useful.

An expression statement evaluates the expression list (which may be a single expression).

In interactive mode, if the value is not None, it is converted to a string using the built-in repr function and the resulting string is written to standard output (see print) on a line by itself. (Expression statements yielding None are not written, so that procedure calls do not cause any output.)