Loop from 'aaaa' to 'tttt' ?

Lars Schaps tuffi23 at gmx.de
Mon Jun 16 13:04:30 EDT 2003


Hello.

In my program in need a loop from 'aaaa' over
'aaac', 'aaag', 'aaat', 'aaca' to 'tttt'.
(Possible characters 'a', 'c', 'g' and 't')

One idea i had is to take a number n with the base of
4 and use 

t= string.translate( '0123', 'acgt')
string.translate( n, t)

But i don't know how to convert from base10 to base4.

Has anyone a idea?

Lars




More information about the Python-list mailing list