프로그래머스. 핸드폰 번호 가리기 파이썬 풀이

minan·2021년 6월 28일
0

프로그래머스

목록 보기
66/92

프로그래머스. level 1. 핸드폰 번호 가리기 파이썬 풀이

문제링크 https://programmers.co.kr/learn/courses/30/lessons/12948

def solution(phone_number):
    answer = ''
    
    # 4자리 빼고 다 *처리
    answer = (len(phone_number)-4) * '*'
    # 끝 4자리만 가져와서 +
    answer += phone_number[-4:]
    
    return answer
profile
https://github.com/minhaaan

0개의 댓글