In <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > At Monday 11/12/2006 07:22, [EMAIL PROTECTED] wrote: > >>elif int(uniList[0]) in range(0,10): > > Either of these will work to avoid an unneeded conversion: > > elif uniList[0] in "0123456789": > > elif uniList[0] in string.digits: > > elif uniList[0].isdigit():
The last does not work. Not only that it accepts numbers greater than 9 because it checks if the whole string consists of digits, it also accepts u'²₂' and other unicode digits. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list