[Tutor] Return T/F vs print T/F

bob gailer bgailer at gmail.com
Sat Feb 4 21:49:58 CET 2012


On 2/4/2012 11:53 AM, Steven D'Aprano wrote:
[snip]
>
> In the interactive interpreter, as a convenience, the result of each 
> line is automatically printed for you:
>
Actually the interpreter prints the result of each /statement /that IS 
an /expression/.
 >>> 2
2
 >>> a = 3
 >>> a
3
IOW if the line is blank, start with # or is a statement the interpreter 
does not print anything (unless it is a print statement). For a messy 
example:

 >>> if 1:3;a=4;a
...
3
4

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120204/3e4fc2f7/attachment.html>


More information about the Tutor mailing list