Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

BIOL4292: Example Assignment

Specifcation for Example Assignment

his, the ńrst task in a portfolio of three assesses the following programming fundamen- tals:

●  String comparisons

●  Flow control

  Simple and Nested Looping

When implementing this specińcation, make sure that the only output generated by your program is the output you have been asked to generate. You cannot use any library functions to test for substring matches – however, you can use the in’ operator. Your task is to write a Python script that does the following:

●  Reads in strings that a user types in via a keyboard. he strings should be stored for later use. hese strings should be composed of the characters A’, ‘C’, ‘G’ and ‘T’; it is an error if they are not, and any string containing other characters should not be stored. he strings should continue to be read in until an empty string is inputted.

●  Reads in a second collection of strings, with the same specińcation as the ńrst collection

●  Prints a newline by itself

●  Checks to see if strings from the ńrst collection are substrings of strings from the second collection. For every string that is a substring, you should print out the following ’<substring from 1> is a substring of <substring from 2>’, not including quotes, putting the correct strings in the placeholders. E.g. AGGC is a substring of CTAAGGCT.

  Only print the ńrst match for strings in the ńrst collection. E.g. if AGC is in the ńrst collection and AGCT and TAGC are in the second collection, only print the match with AGCT.

  You may only use the ‘in’ keyword to check if a string is a substring of another string.

Remember to write good code” in the sense of what was discussed in Lecture 3. he code should be correct, emcient and maintainable, with descriptive variables, consistent formatting, good spacing and useful comments.

Addendum

It might be helpful to create a driver to test your program. his is another program that can start up your Python script and input the strings you want to test with. he easiest way to do this is probably via a shell script and the input redirection operator ‘<’, which will allow you to redirect the contents of a ńle to the input of your Python program.