Created
October 14, 2012 15:22
-
-
Save ychaouche/3888894 to your computer and use it in GitHub Desktop.
ADN parser
This file contains 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
>>> bar = lambda x:all(map(lambda x:x in "ATCG",x)) | |
>>> bar("AGCT") | |
True | |
>>> bar("AGCTACCCTTA") | |
True | |
>>> bar("AGCTACCCTTA1") | |
False | |
>>> |
sir plss give me suggestion regarding these descripton
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sir this is not what i want
Header :is_valid_sequence:
Type Contarct :(str) -> bool
There are at least 2 ways to approach this. One way is to can count the number of characters that are not nucleotides and then at the end check whether there were more than zero. Another way is to use a Boolean variable that represents whether you have found a non-nucleotide character; it would start off as True and would be set to False if you found something that wasn't an 'A', 'T', 'C' or 'G'.
You should construct examples that contain only 'A's, 'T's, 'C's and 'G's, and you should also create examples that contain other characters. Lowercase characters are not valid.