-
-
Save kellegous/7d62d22912439b3842e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def parse_num(str): | |
try: | |
return int(str) | |
except ValueError: | |
pass | |
try: | |
return float(str) | |
except ValueError: | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment