confusion with encryption
<p>I'm trying to write a program that generates a list with the numbers from 1 to 26 in random order, then 'encrypts' a given word using that list so that the n'th letter of the alphabet is mapped to the n'th number in the randomized list. Example:</p>

<p>the randomized list is:</p>

<pre><code>[8,2,25,17,6,9,12,19,21,20,18,3,15,1,11,0,23,14,4,7,24,5,10,13,16,22]
</code></pre>

<p>which means that the word <code>act</code> becomes <code>[8,25,7]</code> and the word <code>xyzzy</code> becomes <code>[13,16,22,22,16]</code>.</p>

<p>I have the following code, but I'm not sure how to proceed:</p>

<pre><code>#8a
def randomalpha():
    a=[0]*26
    count = 0
    while count &lt; 25:
        r = randrange(0,26)
        if r not in a:
            a[count] = r
            count += 1
    return(a)
print(f())
#8b
ls=['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']
def encrypt(alphabet):
    a=randomalpha()
    count=0
    b=input('enter a word')
    for i in b:               #not sure if i am ok up to here but this is when i got really confused 


print(encrypt(ls))
</code></pre>
