Created
July 9, 2021 06:51
-
-
Save inspirit941/553a7417bccf1af6d0be3ea1d6ec7e13 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 solution(s): | |
table = { | |
"zero" : "0", | |
"one" : "1", | |
"two" : "2", | |
"three" : "3", | |
"four" : "4", | |
"five" : "5", | |
"six" : "6", | |
"seven" : "7", | |
"eight" : "8", | |
"nine" : "9" | |
} | |
for key, value in table.items(): | |
s = s.replace(key, value) | |
return int(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment