Jared Nielsen <nielsen.ja...@gmail.com> Wrote in message:
> Hi Pythons,
> Could someone explain the difference between expressions and statements?
> I know that expressions are statements that produce a value.
> I'm unclear on functions and especially strings.
> Are any of the following expressions?
> 
> print(42)
> print("spam")
> spam = 42
> print(spam)
> 
> Is the first example producing a value or simply displaying an integer?
> Does a string count as a value?
> Is a variable assignment considered a value?
> If I print a variable is that considered production of a value?
>

Can't answer till you specify Python version.  The other answers
 all seem to assume version 3.x. In version 2, these are all
 statements,  none are expressions.


-- 
DaveA

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to