Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

'.join(s)

def solution(s, n):
    answer = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' * (n + 1)
    s = list(s)
    for i in range(len(s)):
        a = ord(s[i].upper())
        if s[i] == ' ':
            continue
        if s[i] in answer:
            s[i] = answer[(a + n) % 65]
        else:
            s[i] = answer[(a + n) % 65].lower()
    return ''.join(s)
Source by programmers.co.kr #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
4+3 =