📌  相关文章
📜  ''.join(s) - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:20.529000             🧑  作者: Mango

代码示例1
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)