Skip to main content

Rot13

note

Difficulty: ⭐

This is a classic coding task where you will need to encode user input using rot13. This is simply "rotating" each letter through the alphabet 13 places.

Encoding​

Rot 13 converts like so:

From: abcdefghijklmnopqrstuvwxyz
To: nopqrstuvwxyzabcdefghijklm

So when you run the program ask for input with > and then continuously output the encoding of what they type.

Make sure that special characters are ignored. And make sure that captilisation is preserved in the output.

Example​

$ python rot13.py
> Hello World
Uryyb Jbeyq
> This is encoded. But watch when I input Uryyb Jbeyq
Guvf vf rapbqrq. Ohg jngpu jura V vachg Hello World
>