Python code for rosalind.info