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