Skip to content

Instantly share code, notes, and snippets.

@daviddamilola
Created September 27, 2023 16:33
Show Gist options
  • Save daviddamilola/9b1c7b0ffe20c6b44f064f401eae6c65 to your computer and use it in GitHub Desktop.
Save daviddamilola/9b1c7b0ffe20c6b44f064f401eae6c65 to your computer and use it in GitHub Desktop.
testInput = 'AAAACCCGGT'
def getReverseComplement (DnaString):
allowedTypesMap = {'A': 'T', 'G': 'C', 'T':'A', 'C': 'G'}
result = [allowedTypesMap[char] for char in (DnaString)]
return ("".join(result))[::-1]
print(getReverseComplement(testInput))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment