On 04/11/11 01:42, Steven D'Aprano wrote:
Alan Gauld wrote:

If you're worried about the screen space and/or keystrokes, you can do
this:

if direction.upper() in tuple('NSEW'): ...

It's not so much the keystrokes that I don't like but it's the fact that I invariably miss out a quote or a comma every time I try to construct a long sequence of single character strings. This avoids
that by getting Python to do the work for me.

I like it! The best of both worlds. :-)


Thanks Stephen,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

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

Reply via email to