How to check if a string "is" an int?

Neuruss luismgz at gmail.com
Wed Dec 21 06:37:27 EST 2005


Can't we just check if the string has digits?
For example:

>>> x = '15'
>>> if x.isdigit():
	print int(x)*3

	
45
>>>




More information about the Python-list mailing list