On 27/11/11 19:02, Hugo Arts wrote:
if name[0] == "m" or name[0] == "f" or name[0] == "b":
or, more idiomatically, you can use the in operator like this:
if name[0] in ("m", "f", "b"):
And you might want to force it to lower case too:
if name[0].lower() in ("m", "f", "b"):
OTOH you might want it to be case sensitive...
--
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