Hong-Phuc Bui
2026-07-06 a45bdced8968f14a0f70c3adb15030d4682c0b04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"ACGT-TCGA-AACC-ACCT-CCTA"
 
{
    "A": 2,
    "C": 3,
    "G": 4,
    "T": 2
}
 
def count_agct(dna:str) -> dict[str,int]:
    table = {
        "A": 0, "C": 0, "G": 0, "T": 0
    }
    erlaubt_zeichen = table.keys()
    for c in dna:
        molecule = c.upper()
        if molecule in erlaubt_zeichen:
            count = table[molecule]
            table[molecule] = count + 1
    return table
 
t = count_agct("ACGT-AACc-CGGTT")
print(t)