#!/usr/local/bin/python3
# Python challenge - 1
# http://www.pythonchallenge.com/pc/def/map.html


def main():
    '''
    Hint:
    K -> M
    O -> Q
    E -> G
    '''

    cipher_text = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."

    plain_text = caesar_cipher(cipher_text, 2)
    print(plain_text)

    print(caesar_cipher('/map', 2))
    # change /map.html to /ocr.html


def caesar_cipher(cipher_text, n):
    '''
    Input: string of cipher_text, n is int for alphabet rotation
    Output: string of plain text, applying simple n rotation
    '''
    # Convert cipher_text to lowercase
    cipher_lower = cipher_text.lower()

    # Create cipher key dictionary
    codex = {}
    base = ord('a')

    for i in range(26):
        # Assumes a is 0, z is 25
        letter = chr(base + i)
        rotated_letter = chr(((i + n) % 26) + base)
        codex[letter] = rotated_letter

    # Build plain_text string using the codex mapping
    plain_text = ''

    for c in cipher_lower:
        plain_text += codex.get(c, c)

    return plain_text

# Keyword: ocr


if __name__ == '__main__':
    main()

@@ -86,24 +86,39 @@
 ef/map.html%0A
+# Keyword: ocr%0A
 %0A%0Adef main()
@@ -197,17 +197,18 @@
 _text = 
-%22
+('
 g fmnc w
@@ -257,16 +257,38 @@
 amknsrcp
+'%0A                   '
 q ypc dm
@@ -333,19 +333,42 @@
 ylb rfyr
+%5C
 'q 
+'%0A                   '
 ufw rfgq
@@ -413,16 +413,38 @@
 lq() gq 
+'%0A                   '
 pcamkkcl
@@ -473,9 +473,10 @@
 spj.
-%22
+')
 %0A%0A  
@@ -534,69 +534,67 @@
 int(
-plain_text)%0A%0A    print(caesar_cipher('/map', 2))%0A    # change
+%22PLAIN TEXT:%22)%0A    print(plain_text)%0A%0A    # Apply cipher to
  /ma
@@ -600,18 +600,20 @@
 ap.html 
+(ge
 t
-o
  /ocr.ht
@@ -614,16 +614,83 @@
 ocr.html
+)%0A    print('NEW ADDRESS PATH')%0A    print(caesar_cipher('/map', 2))
 %0A%0A%0Adef c
@@ -1356,32 +1356,16 @@
 n_text%0A%0A
-# Keyword: ocr%0A%0A
 %0Aif __na

Refactor code, fix PEP errors