You will write three small functions that count a cross with one gene. The genotypes are written as two letters, such as "Tt". Capital T is dominant.
The idea. Pair every allele of one parent with every allele of the other. Sort each pair so that the capital letter comes first, so "tT" becomes "Tt".
Your tasks.
cross. It gives a dictionary: the genotype and the number of the 4 boxes that hold it.dominant_share. It gives the share of the offspring that show the dominant trait, as a fraction.unknown_plant. In a test cross of a tall plant with a dwarf plant, it names the genotype of the tall plant from the numbers of tall and dwarf offspring.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…
With Standard, you also open 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.