def solution(s):
answer = 0
num_dict = {
'zero' : '0',
'one' : '1',
'two' : '2',
'three' : '3',
'four' : '4',
'five' : '5',
'six' : '6',
'seven' : '7',
'eight' : '8',
'nine' : '9',
}
for k, v in num_dict.items():
s = s.replace(k, v)
return int(s)
'Python 문제풀이 > 프로그래머스&해커랭크' 카테고리의 다른 글
타겟 넘버 (DFS/BFS) / nonlocal (0) | 2022.04.01 |
---|---|
없는 숫자 더하기 (0) | 2021.11.17 |
신규 아이디 추천 (0) | 2021.11.17 |
로또의 최고 순위와 최저 순위 (0) | 2021.11.17 |
두 개 뽑아서 더하기 (0) | 2021.01.06 |