Ad
Code
Diff
  • print([number for tuple in [(i, i*2) for i in range(1, 10)] for number in tuple])
    
    • lst_gen = list(sum([(i, i*2) for i in range(1, 10)],()))
    • print(lst_gen)
    • print([number for tuple in [(i, i*2) for i in range(1, 10)] for number in tuple])
Code
Diff
  • def reverse_compliment(dna):
        compliment = str.maketrans('ATGC', 'TACG')
        return ''.join(reversed(dna.upper().translate(compliment)))
    • def reverse_compliment(dna):
    • DNA,rdna= dna.upper(),''
    • gen={'A':'T','T':'A','G':'C','C':'G'}
    • for i in DNA: rdna=gen[i]+rdna
    • return rdna
    • compliment = str.maketrans('ATGC', 'TACG')
    • return ''.join(reversed(dna.upper().translate(compliment)))