Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save inspirit941/553a7417bccf1af6d0be3ea1d6ec7e13 to your computer and use it in GitHub Desktop.
Save inspirit941/553a7417bccf1af6d0be3ea1d6ec7e13 to your computer and use it in GitHub Desktop.
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