Solution: DNA sequencing with filter and lambda
dna = 'ACCGXXCXXGTTACTGGGCXTTGT'
sequences = dna.split('X')
sequences.sort(key=len, reverse=True)
print(sequences)
sequences = list( filter(lambda x: len(x) > 0, sequences) )
print(sequences)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
dna = 'ACCGXXCXXGTTACTGGGCXTTGT'
sequences = dna.split('X')
sequences.sort(key=len, reverse=True)
print(sequences)
sequences = list( filter(lambda x: len(x) > 0, sequences) )
print(sequences)