A strand of DNA is a string of letters. You will write a function that gives the partner strand. Then you will count the hydrogen bonds between the two strands and the share of G and C in the strand.
The idea. In DNA, A pairs with T, and G pairs with C. An A-T pair has two hydrogen bonds and a G-C pair has three. A dictionary is a good way to hold the pairing rule.
Your tasks.
partner, return the partner strand: the partner of each base, in order.bonds to the number of hydrogen bonds between strand and its partner.gc_percent to the per cent of the bases in strand that are G or C.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…