Module 13
Validate sequence
Checking the input is valid.
Validation
The first step is to check that the sequence contains only valid bases.
def is_valid(seq):
return all(base in "ATGC" for base in seq)
print(is_valid("ATGC"))
print(is_valid("ATGX"))Your task
Validate
- Write is_valid(seq) and test it.