removing the ' from list elements

smst smstNOsmSPAM at bigfoot.com.invalid
Wed Mar 8 16:08:08 CET 2000


In article <38C662F0.1C9FAC88 at bellatlantic.net>, Steve Holden
<sholden at bellatlantic.net> wrote:
>
>mths = {'01': 'Jan', '02': 'Feb', ... , '12': 'Dec'} # As
initialisation, once
> >     if mo == 'Jan':
> >         m = '01'
[etc]

>try:
>    m = mths[mo]
>except KeyError:
>    m = None

Steve,

Close, but you got the dictionary backwards!  It should have
been:
mths = {'Jan': '01', 'Feb': '02', ... , 'Dec': '12'}

Sorry to be picky, but that could have caused a confusing
error...

Cheers,
Steve Tregidgo
http://www.businesscollaborator.com


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!




More information about the Python-list mailing list