Bill wrote:

> def month_number(monthabbr):
>     """Return the month number for monthabbr; e.g. "Jan" -> 1."""
>     for index, day in enumerate(calendar.month_abbr):
>         if day == monthabbr:
>             return index
> 
> which works well enough but isn't very clever.  I'm pretty new to
> Python; what am I missing here?
> Thanks -- Bill.

I'm curious, does that really work, or is there a problem with the first 
index being 0? Or is that avoided somehow?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to