[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

'Programming > Programmers' 카테고리의 다른 글

[Python] Lv1 K번째수  (0) 2025.03.02
[Python] Lv1 과일 장수  (0) 2025.03.02
[Python] Lv1 정수 내림차순으로 배치하기  (0) 2025.03.02
[Python] Lv1 자릿수 더하기  (0) 2025.03.02
[Python] Lv1 약수의 합  (0) 2025.03.02

BELATED ARTICLES

more