https en wikipedia orgwikidna returns the second side of a dna strand dnagcta cgat dnaatgc tacg dnactga gact dnagfgg traceback most recent call last valueerror invalid strand https en wikipedia org wiki dna returns the second side of a dna strand dna gcta cgat dna atgc tacg dna ctga gact dna gfgg traceback most recent call last valueerror invalid strand
import re


def dna(dna: str) -> str:
    

    if len(re.findall("[ATCG]", dna)) != len(dna):
        raise ValueError("Invalid Strand")

    return dna.translate(dna.maketrans("ATCG", "TAGC"))


if __name__ == "__main__":
    import doctest

    doctest.testmod()