Help me in solving ENCMSG problem

My issue

a = input()
s = list(a)
for i in range(0,len(s)-1,2):
s[i],s[i+1]=s[i+1],s[i]
q = “”.join(s)
f =
for l in q:
t = ord(l)
e = 97+122-t
r = chr(e)
f.append(r)
m = “”.join(f)
print(m)

please debug this

My code

a = input()
s = list(a)
for i in range(0,len(s)-1,2):
    s[i],s[i+1]=s[i+1],s[i]
q = "".join(s)
f = []
for l in q:
    t = ord(l)
    e = 97+122-t
    r = chr(e)
    f.append(r)
m = "".join(f)
print(m)


Problem Link: Encoding Message Practice Coding Problem - CodeChef

@anon46112266
plzz refer the following python code for better understanding of the logic and implementation.

# cook your dish here
num = int(input())

for x in range(num):
    length = int(input())
    string = input()
    lst = list(string)
    
    if (length % 2 != 0):
        lengthx = length - 1
    else:
        lengthx = length
    
    for y in range(0, lengthx, 2):
        temp = lst[y]
        lst[y] = lst[y + 1]
        lst[y + 1] =  temp
    
    #string = ''.join(lst)
    
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    for x in range(0, length):
        lst[x] = alphabet[25 - alphabet.index(lst[x])]
    
    string = ''.join(lst)
    print(string)