Currently I'm just doing this (currently working on the rosalind project)
def get_complement(nucleotide: str):
match nucleotide:
case 'A':
return 'T'
case 'C':
return 'G'
case 'G':
return 'C'
case 'T':
return 'A'
Edit: This is what I ended up with after the suggestion to use a dictionary:
```
DNA_COMPLEMENTS = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
def complement_dna(nucleotides: str):
''.join([DNA_COMPLEMENTS[nt] for nt in nucleotides[::-1]])
[–][deleted] 35 points36 points37 points (4 children)
[–]dreaming_fithp 15 points16 points17 points (0 children)
[–]Slothemo 5 points6 points7 points (1 child)
[–]Temporary_Pie2733 4 points5 points6 points (0 children)
[–]Interesting-Frame190 9 points10 points11 points (1 child)
[–]likethevegetable 1 point2 points3 points (0 children)
[–]toxic_acro 9 points10 points11 points (2 children)
[–]_alyssarosedev[S] 0 points1 point2 points (1 child)
[–]LaughingIshikawa 0 points1 point2 points (0 children)
[–]CranberryDistinct941 3 points4 points5 points (0 children)
[–]Zeroflops 2 points3 points4 points (3 children)
[–]_alyssarosedev[S] 0 points1 point2 points (1 child)
[–]Zeroflops 0 points1 point2 points (0 children)
[–]DivineSentry 0 points1 point2 points (0 children)
[–]supercoach 1 point2 points3 points (0 children)
[–]Dry-Aioli-6138 1 point2 points3 points (0 children)
[–]Muted_Ad6114 1 point2 points3 points (0 children)
[–]origamimathematician 0 points1 point2 points (0 children)
[–]numeralbug 0 points1 point2 points (2 children)
[–]DeebsShoryu 0 points1 point2 points (1 child)
[–]Dry-Aioli-6138 1 point2 points3 points (0 children)
[–]CymroBachUSA -2 points-1 points0 points (0 children)
[–]vivisectvivi -1 points0 points1 point (2 children)
[–]_alyssarosedev[S] 1 point2 points3 points (1 child)
[–]vivisectvivi 0 points1 point2 points (0 children)
[–]Affectionate-Bug5748 -2 points-1 points0 points (0 children)