Richard van de Stadt <stadt at cs.utwente.nl> wrote in comp.lang.python: > I needed a function to check if a string is a number. If you are using Python 1.6 or 2.0, strings have the isdigit() method: >>> x = "0" >>> x.isdigit() 1 >>> x = "1234" >>> x.isdigit() 1 >>> x = "1234a" >>> x.isdigit() 0 -- Remco Gerlich