Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- genotype = [0,0]
- homoDom=0;
- heteroDom=0;
- homoRec=0;
- dom=0;
- rec=0;
- bigtable=[]
- print "Genotype\t| Genotype name\t\t| Phenotype"
- print "====================================================="
- for x in range(0,100):
- genotype[0]=int(random.randrange(0,100)/50)
- genotype[1]=int(random.randrange(0,100)/50)
- if genotype[0] == 1:
- if genotype[1] == 1:
- print "RR \t\t| homozygous dominant\t| normal skin"
- bigtable.append(["RR", "homozygous dominant", "normal skin"])
- homoDom+=1
- else:
- print "Rr \t\t| heterozygous dominant\t| normal skin"
- bigtable.append(["Rr", "heterozygous dominant", "normal skin"])
- heteroDom+=1
- else:
- if genotype[1] == 1:
- print "rR\t\t| heterozygous dominant\t| normal skin"
- bigtable.append(["rR", "heterozygous dominant", "normal skin"])
- heteroDom+=1
- else:
- print "rr\t\t| homozygous recessive\t| albino"
- bigtable.append(["rr", "homozygous recessive", "normal skin"])
- homoRec+=1
- print "Statistics:"
- print "RR: "+str(homoDom)+"/100 Rr or rR: "+str(heteroDom)+"/100 rr: "+str(homoRec)+"/100."
- rec=homoRec
- dom=homoDom+heteroDom
- print str(dom)+"/100 were dominant. "+str(rec)+"/100 were recessive."
- blabla=raw_input("Press ENTER to continue... ")
Advertisement
Add Comment
Please, Sign In to add comment