[프로그래머스] 숫자 문자열과 영단어

Doodung·2021년 7월 15일
0

코딩테스트

목록 보기
4/8
import re
def solution(s):
    dic={'zero':'0','one':'1','two':'2','three':'3','four':'4','five':'5','six':'6','seven':'7','eight':'8','nine':'9'}
    
    for i,j in dic.items():
        if i in s:
            s=re.sub(i,j,s)
    
    return int(s)
profile
반가워요!

0개의 댓글