Help me in solving DNASTORAGE problem

My issue

what is my mistake

My code

t = int(input())
for _ in range(t):
    n = int(input())
    s = input()
    for i in range(0, len(s), 2):
        if s[i] == '0' and s[i+1] == '0':
            print("A")
        elif s[i] == '0' and s[i+1] == '1':
            print("T")
        elif s[i] == '1' and s[i+1] == '0':
            print("C")
        else:
            print("G")

Learning course: Strings using Python
Problem Link: DNA Storage Practice Problem in - CodeChef

# cook your dish here

number_of_test_case = int(input())

for _ in range(number_of_test_case):
  length = int(input())
  string = input()
  encode = ""

  i = 0
  while(i < length):
      first = string[i]
      second = string[i+1]
      
      if(first == '0'):
          if(second == '0'):
              encode = encode + 'A'
          else:
              encode = encode + 'T'
      else:
          if(second == '0'):
              encode = encode + 'C'
          else:
              encode = encode + 'G'
              
      
      i = i + 2
      
  print(encode)

create an empty string then store encoded values to it, after that print the string as output