return not leftover
with open('example.fasta') as handle:
    first_record = list(SeqIO.parse(handle, 'fasta'))[0]
valid_alphabets = [str(alphabet) for alphabet in alphabets if validate(
    first_record.seq, alphabet)]
print('Valid alpahabet(s) for fasta file: {}'.format(', '.join(valid_alphabets)
    ))
Оцените алфавит в Biopython из файла fasta