12 lines
801 B
Markdown
12 lines
801 B
Markdown
## Expression Statements
|
|
|
|
Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a method (a function that does not return a meaningful result; in Python, methods return the value `None` ). Other uses of expression statements are allowed and occasionally useful. The syntax for an expression statement is:
|
|
|
|
```javascript
|
|
expression_stmt ::= starred_expression
|
|
```
|
|
|
|
An expression statement evaluates the list of expressions (which can be a single expression).
|
|
|
|
In interactive mode, if the value is not `None` , it is converted to a string using the built-in function `repr()` , and the resulting string is written to the standard output on a line by itself (except if the result is `None` , in which case the called procedure produces no output).
|