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)
|
|