Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

An expression is something, while a statement does something.
An expression is a statement as well, but it must have a return.


\>>> 2 * 2 #expression
>>> 2 * 2     #expression
>>> print(2 * 2)   #statement

>>> print(2 * 2) #statementPS:The interpreter always prints out the values of all expressions.


PS:The interpreter always prints out the values of all expressions.

An expression is something, while a statement does something.
An expression is a statement as well, but it must have a return.


\>>> 2 * 2 #expression

>>> print(2 * 2) #statement


PS:The interpreter always prints out the values of all expressions.

An expression is something, while a statement does something.
An expression is a statement as well, but it must have a return.

>>> 2 * 2     #expression
>>> print(2 * 2)   #statement

PS:The interpreter always prints out the values of all expressions.

deleted 5 characters in body
Source Link

An expression is something, while a statement does something.
An expression is a statement as well, but it must have a return.

>>> 2 * 2 #expression


\>>> 2 * 2 #expression

>>> print(2 * 2) #statement #statement

PS:The interpreter always prints out the values of all expressions.


PS:The interpreter always prints out the values of all expressions.

An expression is something, while a statement does something. An expression is a statement as well, but it must have a return.

>>> 2 * 2 #expression

>>> print(2 * 2) #statement

PS:The interpreter always prints out the values of all expressions.

An expression is something, while a statement does something.
An expression is a statement as well, but it must have a return.


\>>> 2 * 2 #expression

>>> print(2 * 2) #statement


PS:The interpreter always prints out the values of all expressions.
Source Link

An expression is something, while a statement does something. An expression is a statement as well, but it must have a return.

>>> 2 * 2 #expression

>>> print(2 * 2) #statement

PS:The interpreter always prints out the values of all expressions.

lang-py

AltStyle によって変換されたページ (->オリジナル) /