코딩테스트/Programmers
[Python] 프로그래머스 Lv1 : 핸드폰 번호 가리기
이긍빈
2025. 3. 2. 16:48
def solution(phone_number):
phone_num_list = list(phone_number)
for i in range(len(phone_num_list)):
if i == (len(phone_num_list)-4):
break
phone_num_list[i] = "*"
answer = ''.join(phone_num_list)
return answer