changing numbers to spellings

MonkeeSage MonkeeSage at gmail.com
Sun Oct 1 20:26:43 EDT 2006


Tim Williams wrote:
> my_nums = { 1 : 'One' , 2 : 'Two' ,  3 : 'Three' , 4 : 'Four' }  # etc etc
> print my_nums[x]

That's what I suggested, but since a list is already zero indexed I
used that rather than a dictionary. And Paul Rubin posted a very nice
solution that handles numbers larger than 9. I think the OP wants us to
write their GUI code for them or something...

Regards,
Jordan




More information about the Python-list mailing list