I have this equation for reverse complementing DNA in python:
def complement(s):
basecomplement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
letters = list(s)
letters = [basecomplement[base] for base in letters]
return ''.join(letters)
def revcom(s):
complement(s[::-1])
print("ACGTAAA")
print(complement("ACGTAAA"[::-1]))
print(revcom("ACGTAAA"))
however the lines:
print(complement("ACGTAAA"[::-1]))
print(revcom("ACGTAAA"))
do not equal one another. only the top line gives an answer. the bottom just prints "NONE"
any help why this is?