[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

BELATED ARTICLES

more