Created
December 18, 2018 15:29
-
-
Save khaerulumam42/0afecc27d3a1376d9b3ef7f88773f79c 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
def is_number(s): | |
try: | |
float(s) | |
return True | |
except ValueError: | |
pass | |
try: | |
import unicodedata | |
unicodedata.numeric(s) | |
return True | |
except (TypeError, ValueError): | |
pass | |
return False | |
def dictkeys_from_value(dictio, value): | |
idx_val = list(dictio.values()).index(value) | |
return list(dictio.keys())[idx_val] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment