[Tutor] string to integer

Alan Gauld alan.gauld at freenet.co.uk
Fri Jan 6 09:41:53 CET 2006


>> nums = [ch for ch in aString if ch in string.digits]

> I'd spell that
> 
> nums = [ch for ch in aString if ch.isdigit()]

Now I had a look for a digit() method but never notoced 
the isdigit() one.

Thanks Brian.

Alan G.


More information about the Tutor mailing list