Skip to content

Instantly share code, notes, and snippets.

@brizandrew
Created August 5, 2016 19:45
Show Gist options
  • Save brizandrew/8bb2642258b85e3c5f12a3a1a128d63f to your computer and use it in GitHub Desktop.
Save brizandrew/8bb2642258b85e3c5f12a3a1a128d63f to your computer and use it in GitHub Desktop.
"""
@function isNumber
Utility function to determine if a string is a valid number
@param {str} string: The string to test
@return {boolean}: Whether or not it's a valid number
"""
def isNumber(string):
try:
float(string)
return True
except ValueError:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment