๋ธŒ๋ก ์ฆˆ1 : ๊ตฌํ˜„ ๋ฌธ์ œ์ด๋‹ค.

ํ’€์ด

๋‹จ์ˆœํ•œ ๋ฌธ์ œ์ด๋‹ค. ์•ž๋’ค์— ์–ด๋– ํ•œ ๋ฌธ์ž๋ฅผ ๋„ฃ์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ, ํ˜„์žฌ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ROT13๋งŒ ๊ฐ€์ง€๊ณ ์„œ ๋ถ€๋ถ„์ ์œผ๋กœ ๋ณด์•˜์„ ๋•Œ, ๊ฐ€์žฅ ์ž‘์€ ์ฐจ์ด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ง€์ ๋งŒ ์•Œ๋ฉด๋œ๋‹ค. ์ดํ›„๋Š” ๋งž์ถฐ์„œ ๋ผ์›Œ๋„ฃ์œผ๋ฉด ๋˜๋‹ˆ๊นŒ.

Code

import string
 
a = input()
 
alphabet_lower = string.ascii_lowercase
alphabet_upper = string.ascii_uppercase
ret_string = ""
for char in a:
    if char in alphabet_lower:
        pos = alphabet_lower.find(char)
        char = alphabet_lower[(pos + 13) % len(alphabet_lower)]
    elif char in alphabet_upper:
        pos = alphabet_upper.find(char)
        char = alphabet_upper[(pos + 13) % len(alphabet_upper)]
    ret_string += char
 
print(ret_string)

Reference