[Tutor] correcting an Active State Recipe for conversion to ordinal

Alan Gauld alan.gauld at btinternet.com
Thu Feb 4 18:52:25 CET 2010

"Serdar Tumgoren" <zstumgoren at gmail.com> wrote

> was hoping that you all could help me "crowdsource" the issue. If you
> have the time and inclination, could you look at the code and tell me
> if and where I've gone wrong?

Not sure about the reported bugs but some comments:

What happens if

if value % 100/10 <> 1is false? eg. 110-119There is no else so the function 
will return None.Or do you have future divisuion turned on?In that case the 
if will only error on 110...Also <> is deprecated - and not allowed in v3 
so you should probably change it to !=-- Alan GauldAuthor of the Learn to 
Program web sitehttp://www.alan-g.me.uk/ 

More information about the Tutor mailing list