You will write three small functions that count the children of an X-linked cross. An allele is written "XH" (normal), "Xh" (haemophilia) or "Y".
The idea. A child is a pair, the egg and the sperm. A child with a Y is a son. A son is haemophilic if his egg carries Xh. A daughter is a carrier if she has one Xh, and she is haemophilic if she has two.
Your tasks.
cross. It gives the list of the four children, each as a pair (egg, sperm).kind. It names a child: "normal son", "affected son", "normal daughter", "carrier daughter" or "affected daughter".share. It gives the share of the children of one kind, as a fraction.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…