[Tutor] Making a Primary Number List generator
Alan Gauld
alan.gauld at btinternet.com
Thu May 16 01:57:36 CEST 2013
On 16/05/13 00:18, Marc Tompkins wrote:
> On Wed, May 15, 2013 at 3:52 PM, Marc Tompkins <marc.tompkins at gmail.com
> <mailto:marc.tompkins at gmail.com>> wrote:
>
> I was thinking along the lines of an optional parameter ("verbose"
> or something similar), so print() would supply a return value if you
> asked it to but keep stumm if you didn't.
>
>
> After I hit Send, I thought of the obvious problem... you'd have to
> know ahead of time which version of print() was available, because
> you'll get a TypeError if you pass undefined keyword arguments to print().
>
> On the other hand, it'd be a quickie to do that test at the top of your
> code...
Or maybe we need a printf function in Python that has the C behaviour
(and takes other arguments, such as output stream?)
As to bytes v characters I'd opt for bytes since in dealing with
hardware/networks the bytes are more significant than the
characters...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list