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
- for x in range(0,100):
- genotype[0]=int(random()*2+1)
- genotype[1]=int(random()*2+1)
- if genotype[0] == 1:
- if genotype[1] == 1:
- print "RR\t|\thomozygous dominant\t|\tnormal skin"
- homoDom+=1
- else:
- print "Rr\t|\theterozygous dominant\t|\tnormal skin"
- heteroDom+=1
- else:
- if genotype[1] == 1:
- print "rR\t|\theterozygous dominant\t|\tnormal skin"
- heteroDom+=1
- else:
- print "rr\t|\thomozygous recessive\t|\talbino"
- homoRec+=1
- 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."
Advertisement
Add Comment
Please, Sign In to add comment