level1 (2) 썸네일형 리스트형 [프로그래머스] level1 - 숫자 문자열과 영단어 코딩테스트 연습 - 숫자 문자열과 영단어 네오와 프로도가 숫자놀이를 하고 있습니다. 네오가 프로도에게 숫자를 건넬 때 일부 자릿수를 영단어로 바꾼 카드를 건네주면 프로도는 원래 숫자를 찾는 게임입니다. 다음은 숫자의 일부 자 programmers.co.kr 나의코드 def solution(s): s = s.replace('one','1') s = s.replace('two','2') s = s.replace('three','3') s = s.replace('four','4') s = s.replace('five','5') s = s.replace('six','6') s = s.replace('seven','7') s = s.replace('eight','8') s = s.replace('nine','9'.. [프로그래머스] Level1 - 신규 아이디 추천* 코딩테스트 연습 - 신규 아이디 추천 카카오에 입사한 신입 개발자 네오는 "카카오계정개발팀"에 배치되어, 카카오 서비스에 가입하는 유저들의 아이디를 생성하는 업무를 담당하게 되었습니다. "네오"에게 주어진 첫 업무는 새로 programmers.co.kr 나의코드 import re def solution(new_id): answer = '' new_id=new_id.lower() chars = "~!@#$%^&*()=+[{]}:?,/" for c in range(len(chars)): new_id=new_id.replace(chars[c],"") new_id=re.sub('[.]+', '.', new_id) new_id=new_id.strip('.') if len(new_id)==0: new_id='a' .. 이전 1 다음