Created
October 14, 2012 15:29
-
-
Save ychaouche/3888918 to your computer and use it in GitHub Desktop.
lazy version of the ADN parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def is_valid_sequence(sequence): | |
| for character in sequence: | |
| if character not in "ACTG": | |
| return False | |
| return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
insert_sequence:
(str, str, int) -> str
The first two parameters are DNA sequences and the third parameter is an index. Return the DNA sequence obtained by inserting the second DNA sequence into the first DNA sequence at the given index. (You can assume that the index is valid.)
For example, If you call this function with arguments 'CCGG', 'AT', and 2, then it should return 'CCATGG'.
When coming up with more examples, think about where the second DNA sequence might be inserted: what are the extremes?