programmers- lv.1 (둘만의 암호)

이예송·2023년 7월 16일

PS

목록 보기
41/97

문제링크: 둘만의 암호

✍🏻 Information

content
언어python
난이도⭐️
풀이시간5분
제출횟수1
인터넷검색유무yes




🍒 My Code

def solution(s, skip, index):
    answer = ''
    alpha = "abcdefghijklmnopqrstuvwxyz"
    for i in skip:
        alpha = alpha.replace(i,"")
    for i in s:
        answer += alpha[(alpha.find(i)+index)%len(alpha)]
    return answer




💡 What I learned

  • 검색한 내용: string에서 특정 문자를 제거하는 방법(replace를 사용)

0개의 댓글