A tall pea plant (Tt) is crossed with a short one (tt). You will fill a Punnett square in code, count the tall offspring, and find the share of short ones.
The idea. Each gamete carries one copy. Pair every copy of the first parent with every copy of the second. Sort each pair, so that tT is written Tt. A genotype with a T is tall.
Your tasks.
square to the list of the four genotypes, one for each box.tall to the number of tall genotypes in square.short_share to the fraction of the offspring that is short.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…