Created
August 5, 2016 19:45
-
-
Save brizandrew/8bb2642258b85e3c5f12a3a1a128d63f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
@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