[Tutor] Are you allowed to shoot camels? [kinda OT]

Smith, Jeff jsmith at medplus.com
Tue Feb 8 19:32:57 CET 2005


Not to be nit-picky but it's still not the same.  The switch would give
no output but yours would give a newline.  I think the sys write
solution would be the closest equivalent...and took a lot longer for us
to code correctly :-)

Jeff

-----Original Message-----
From: Alan Gauld [mailto:alan.gauld at freenet.co.uk] 
Sent: Tuesday, February 08, 2005 1:24 PM
To: Smith, Jeff; Bob Gailer; tutor at python.org
Subject: Re: [Tutor] Are you allowed to shoot camels? [kinda OT]


> That's no good.  You still get something printed out.  In this case:
>
> None

Of course, silly me, p will return the default value None, you need 
to replace the pass with return '' or, I guess use the lambda...

> ftable = { 'a' : lambda: 'a',...
>           'd' : lambda: ''}

Now it should work and is consistent again! But only for this 
trivial case of printing a label...

Alan G.



More information about the Tutor mailing list