checking if a string contains a number

egbert egbert.bouwman at hccnet.nl
Tue Dec 20 15:55:37 CET 2005


On Tue, Dec 20, 2005 at 07:16:46PM +0530, Suresh Jeevanandam wrote:
> 	s1 = '12e3'
> 	s2 = 'junk'
> 	Is there any other function which would return True for s1 and False 
> for s2.
> 

isinstance(12e3, (int, float))
-- 
Egbert Bouwman - Keizersgracht 197 II - 1016 DS  Amsterdam - 020 6257991
========================================================================



More information about the Python-list mailing list