#Note to self: do decode


#DNA - ATGC
#RNA - AUGC #These are scattered throughout the code. Don't mind them, they are for memeory reasons as I made the code.
def encode(): 
    inputt = input('Input sequence to be encoded (letters, space, numbers, and,.!?@ only!)!') #Asks user for input for encoding (hence, the function name)
    listin = [] #Blank list that will need to be used
    for c in inputt: #Under this, is about 128 lines (before comments) of converting characters to DNA
        #A = 00 T = 01 G = 10 C = 11
        if c == 'a':
            char = 'TGAT'
        if c == 'b':
            char = 'TGAG'
        if c == 'c':
            char = 'TGAC'
        if c == 'd':
            char = 'TGTA'
        if c == 'e':
            char = 'TGTT' #01-10-01-01
        if c == 'f':
            char = 'TGTG' #01-10-01-10
        if c == 'g':
            char = 'TGTC' #01-10-01-11
        if c == 'h':
            char = 'TGGA' #01-10-10-00
        if c == 'i':
            char = 'TGGT' #01-10-10-01
        if c == 'j':
            char = 'TGGG' #01-10-10-10
        if c == 'k':
            char = 'TGGC' #01-10-10-11
        if c == 'l':
            char = 'TGCA' #01-10-11-00
            #DO ac(X)+
        if c == 'm':
            char = 'TGCT' #01-10-11-01
        if c == 'n':
            char = 'TGCG' #01-10-11-10
        if c == 'o':
            char = 'TGCC' #01-10-11-11
        if c == 'p':
            char = 'TCAA' #01-11-00-00
        #DNA - ATGC
        #RNA - AUGC
        if c == 'q':
            char = 'TCAT' #01-11-00-01
        #A = 00 T = 01 G = 10 C = 11
        if c == 'r':
            char = 'TCAG' #01-11-00-10
        if c == 's':
            char = 'TCAC' #01-11-00-11
        if c == 't':
            char = 'TCTA' #01-11-01-00
        if c == 'u':
            char = 'TCTT' #01-11-01-01
        if c == 'v':
            char = 'TCTG' #01-11-01-10
        if c == 'w':
            char = 'TCTC' #01-11-01-11
        if c == 'x':
            char = 'TCGA' #01-11-10-00
        if c == 'y':
            char = 'TCGT' #01-11-10-01
        if c == 'z':
            char = 'TCGG' #01-11-10-10
        if c == 'A':
            char = 'TAAT' #01-00-00-01
        if c == 'B':
            char = 'TAAG' #01-00-00-10
            #ATGC
        if c == 'C':
            char = 'TAAC' #01-00-00-11
        if c == 'D':
            char = 'TATA' #01-00-01-00
        if c == 'E':
            char = 'TATT' #01-00-01-01
        if c == 'F':
            char = 'TATG'
        if c == 'G':
            char = 'TATC' #01-00-01-11
        if c == 'H':
            char = 'TAGA' #01-00-10-00
        if c == 'I':
            char = 'TAGT'
        if c == 'J':
            char = 'TAGG'
        if c == 'K':
            char = 'TAGC'
        if c == 'L':
            char = 'TACA' #01-00-11-00
            #DO ac(X)+
        if c == 'M':
            char = 'TACT'
        if c == 'N':
            char = 'TACG'
        if c == 'O':
            char = 'TACC'
        #A = 00 T = 01 G = 10 C = 1
        if c == 'P':
            char = 'TTAA' #01-01-00-00
        #DNA - ATGC
        #RNA - AUGC
        if c == 'Q':
            char = 'TTAT' 
        if c == 'R':
            char = 'TTAG'
        if c == 'S':
            char = 'TTAC'
        if c == 'T':
            char = 'TTTA'
        if c == 'U':
            char = 'TTTT'
        if c == 'V':
            char = 'TTTG'
        if c == 'W':
            char = 'TTTC'
        if c == 'X':
            char = 'TTGA'
        if c == 'Y':
            char = 'TTGT'
        if c == 'Z':
            char = 'TTGG' #01-01-10-10
        if c == ' ':
            char = 'AGAA' #00-10-00-00
        if c == ',':
            char = 'AGCA' #00-10-11-00
        #A = 00 T = 01 G = 10 C = 11
        if c == '.':
            char = 'AGCG' #00-10-11-10
        if c == '!':
            char = 'AGAT' #00-10-00-01
        if c == '?':
            char = 'ACCC' #00-11-11-11
        if c == '@':
            char = 'TAAA' #01-00-00-00
        if c == '0':
            char = 'ACAA' #00-11-00-00
        if c == '1':
            char = 'ACAT'
        if c == '2':
            char = 'ACAG'
        if c == '3':
            char = 'ACAC'
        if c == '4':
            char = 'ACTA'
        if c == '5':
            char = 'ACTT'
        if c == '6':
            char = 'ACTG'
        if c == '7':
            char = 'ACTC'
        if c == '8':
            char = 'ACGA'
        if c == '9':
            char = 'ACGT'
        listin.append(char) #Take the result of the conversion and add it to the blank list set up earlier.
        #Note, the for statement above means the input will be converted letter by letter and appended in order to the list
    output = ''.join(listin) #Convert list to string
    print(output) #Output string
    main() #Return to prompt

#############################################################################################################################

    
def decode():
    inputt = input('Input sequence to be decoded (Uppercase only!)!') #Asks user for decode
    listin = [] #Blank list needed later
    reallistin = map(''.join, zip(*[iter(inputt)]*4)) #Thanks http://stackoverflow.com/questions/9475241/split-python-string-every-nth-character (takes input and makes list with every 3 characters)
    for c in reallistin: #Each character is decoded (converted to English)
        if c == 'TGAT':
            char = 'a'
        if c == 'TGAG':
            char = 'b'
        if c == 'TGAC':
            char = 'c'
        if c == 'TGTA':
            char = 'd'
        if c == 'TGTT':
            char = 'e' #01-10-01-01
        if c == 'TGTG':
            char = 'f' #01-10-01-10
        if c == 'TGTC':
            char = 'g' #01-10-01-11
        if c == 'TGGA':
            char = 'h' #01-10-10-00
        if c == 'TGGT':
            char = 'i' #01-10-10-01
        if c == 'TGGG':
            char = 'j' #01-10-10-10
        if c == 'TGGC':
            char = 'k' #01-10-10-11
        if c == 'TGCA':
            char = 'l' #01-10-11-00
            #DO ac(X)+
        if c == 'TGCT':
            char = 'm' #01-10-11-01
        if c == 'TGCG':
            char = 'n' #01-10-11-10
        if c == 'TGCC':
            char = 'o' #01-10-11-11
        if c == 'TCAA':
            char = 'p' #01-11-00-00
        #DNA - ATGC
        #RNA - AUGC
        if c == 'TCAT':
            char = 'q' #01-11-00-01
        #A = 00 T = 01 G = 10 C = 11
        if c == 'TCAG':
            char = 'r' #01-11-00-10
        if c == 'TCAC':
            char = 's' #01-11-00-11
        if c == 'TCTA':
            char = 't' #01-11-01-00
        if c == 'TCTT':
            char = 'u' #01-11-01-01
        if c == 'TCTG':
            char = 'v' #01-11-01-10
        if c == 'TCTC':
            char = 'w' #01-11-01-11
        if c == 'TCGA':
            char = 'x' #01-11-10-00
        if c == 'TCGT':
            char = 'y' #01-11-10-01
        if c == 'TCGG':
            char = 'z' #01-11-10-10
        if c == 'TAAT':
            char = 'A' #01-00-00-01
        if c == 'TAAG':
            char = 'B' #01-00-00-10
            #ATGC
        if c == 'TAAC':
            char = 'C' #01-00-00-11
        if c == 'TATA':
            char = 'D' #01-00-01-00
        if c == 'TATT':
            char = 'E' #01-00-01-01
        if c == 'TATG':
            char = 'F'
        if c == 'TATC':
            char = 'G' #01-00-01-11
        if c == 'TAGA':
            char = 'H' #01-00-10-00
        if c == 'TAGT':
            char = 'I'
        if c == 'TAGG':
            char = 'J'
        if c == 'TAGC':
            char = 'K'
        if c == 'TACA':
            char = 'L' #01-00-11-00
            #DO ac(X)+
        if c == 'TACT':
            char = 'M'
        if c == 'TACG':
            char = 'N'
        if c == 'TACC':
            char = 'O'
        #A = 00 T = 01 G = 10 C = 1
        if c == 'TTAA':
            char = 'P' #01-01-00-00
        #DNA - ATGC
        #RNA - AUGC
        if c == 'TTAT':
            char = 'Q' 
        if c == 'TTAG':
            char = 'R'
        if c == 'TTAC':
            char = 'S'
        if c == 'TTTA':
            char = 'T'
        if c == 'TTTT':
            char = 'U'
        if c == 'TTTG':
            char = 'V'
        if c == 'TTTC':
            char = 'W'
        if c == 'TTGA':
            char = 'X'
        if c == 'TTGT':
            char = 'Y'
        if c == 'TTGG':
            char = 'Z' #01-01-10-10
        if c == 'AGAA':
            char = ' ' #00-10-00-00
        if c == 'AGCA':
            char = ',' #00-10-11-00
        #A = 00 T = 01 G = 10 C = 11
        if c == 'AGCG':
            char = '.' #00-10-11-10
        if c == 'AGAT':
            char = '!' #00-10-00-01
        if c == 'ACCC':
            char = '?' #00-11-11-11
        if c == 'TAAA':
            char = '@' #01-00-00-00
        if c == 'ACAA':
            char = '0' #00-11-00-00
        if c == 'ACAT':
            char = '1'
        if c == 'ACAG':
            char = '2'
        if c == 'ACAC':
            char = '3'
        if c == 'ACTA':
            char = '4'
        if c == 'ACTT':
            char = '5'
        if c == 'ACTG':
            char = '6'
        if c == 'ACTC':
            char = '7'
        if c == 'ACGA':