Python homework

From BITS wiki
Jump to: navigation, search

End of day 1 - homework!

Please complete the two exercises below - as we introduced a lot of new concepts it is important that you practice them so we can continue with new ones on the second day.

Exercise sheets

Download these exercise sheets and complete the questions.

Programming exercise

Write a program that does the following:

  1. Ask the user for a full DNA sequence
    1. Make sure the sequence contains only GACT
  2. Once you have a valid sequence
    1. Keep on asking the user for DNA fragments, stop if they just press return
    2. For each DNA fragment the user enters:
      1. Check if it occurs in the full sequence
      2. Print out the sequence position if so
      3. Track each fragment
  3. As a summary, print out all fragments with their position

Back to main page