Caesar Cipher shift by two letters
<pre><code>def main():

    cc = (input("Enter Message to Encrypt\n"))#user input

    shift = int(2) #shift length

    a=["a","b","c","d","e","f","g","h","i","j","k","l",
       "m","n","o","p","q","r","s","t","u","v","w","x","y","z"] #reference list

    newa={} #new shifted reference list

    for i in range (0,len(a)):
        newa [a[i]]=a[(i+shift)%len(a)]
        #adds shifted 2 alaphabet into newalaphabet
        #% moodulus used to wrap

        for i in cc: #iterates through cc
            if i in a:
                    a[i]=cc[i]
                    a[i]=newa[i]

main()
</code></pre>

<p>So I need input from the user #cc</p>

<p>the shift needs to be two</p>

<p>I used an alphabet list</p>

<p>then shift the alphabet by two to create newa</p>

<p>but I do not know how to apply the new alphabet to my user's input</p>

<p>I would just build transition table and use it to decode string.</p>

<pre><code>import string
shift = 2
letters = string.ascii_lowercase + string.ascii_uppercase
transtable = str.maketrans({letters[i]: letters[(i + shift) % len(letters)] 
                            for i in range(len(letters))})

cc = input('Enter string to encode: ')
print(cc.translate(transtable))
</code></pre>

python encryption caesar-cipher