Simple ROT13 Cipher
ROT13 is a simple cipher where each Latin letter is replaced by the letter 13 positions later in the alphabet. Write rot13, which encodes the string message. Uppercase letters should stay uppercase, lowercase letters should stay lowercase, and spaces, digits, and punctuation should not change.
Примеры
Ввод
"test"Вывод
"grfg"Ввод
"Test"Вывод
"Grfg"Ввод
"Hello World!"Вывод
"Uryyb Jbeyq!"Нужно реализовать
def rot13(message: str) -> str:
Теги
strings
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediVisible tests
1
Input
"test"Expected
"grfg"2
Input
"Test"Expected
"Grfg"3
Input
"Hello World!"Expected
"Uryyb Jbeyq!"4
Input
"grfg"Expected
"test"5
Input
"123"Expected
"123"6
Input
"tset"Expected
"gfrg"Focus radio
Paused · SomaFM · Fluid