일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- lv4
- Stack
- itertools
- mysql
- coding
- time complexity
- counter
- python
- 코딩테스트
- Level2
- coding test
- 연습문제
- join
- 시간복잡도
- 코딩
- import re
- sql
- CodingTest
- 코테
- 조합
- level4
- BFS
- lambda
- Queue
- collections
- 데이터분석
- 완전탐색
- 파이썬
- 프로그래머스
- programmers
- Today
- Total
목록신규 아이디 추천 (1)
ror_coding
[Programmers] 신규 아이디 추천 - 72410
re.findall 과 re.sub를 사용해서 특정 문자만 추출하고, str.strip('.')을 사용해서 앞 뒤 특정 문자만 제거. Question 신규 유저가 입력한 아이디를 나타내는 new_id가 매개변수로 주어질 때, "네오"가 설계한 7단계의 처리 과정을 거친 후의 추천 아이디를 return 하도록 solution 함수를 완성해 주세요. Point re.findall ( r'[a-z0-9._-]', ~) : 소문자, 숫자, . _ - 만 찾기.re.sub ( r'\.+' , '.' , ~ ) : ' . ' 이 1개 이상일 때, '.' 로 바꾸기.str.strip ( ' . ' ) : 문자열 가장 앞, 뒤에 .이 있으면 제거. Code import redef solution(new_id): ..
Algorithm/Python
2024. 10. 25. 14:36