Created
November 3, 2017 06:47
-
-
Save Zagrebelin/6fcb9186b84c1cdcfaf149682abeb9a2 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 transform(value): | |
return {'True':True, 'False':False}.get(value, value) | |
d = {'str1': 'True','str2':'string','str3':10} | |
d2 = {key:transform(value) for key, value in d.items()} | |
assert d2 == {'str1': True,'str2':'string','str3':10} | |
print('OK') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment