@AmeliaBlackwell/

AwesomeEvergreenBusinesssoftware

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Black ~~

g2p={"BB":"black","Bb":"black","bB":"black","Bc":"black","cB":"black","bb":"chocolate","bc":"chocolate","cb":"chocolate","cc":"cinnamon"}
p2g={"black":"Bb","chocolate":"bb","cinnamon":"cc"}




mum = p2g[input("input mum pheno: ")]
dad = p2g[input("input dad pheno: ")]

def punnet(mum, dad):
    kittens = []
    for l1 in mum:
        for l2 in dad:
            flag=False
            for kitten in kittens:
                if kitten[0] == l1+l2:
                    kitten[1] += 1
                    flag=True
                    break
            if not flag:
                kittens.append([l1+l2,1])
    return kittens

print([g2p[kitten[0]] for kitten in punnet(mum, dad)])