#! /usr/bin/env python ''' adding a poly-T tail to a sequence ''' #define a function that will add the T tail def add_tail(seq): result = seq + 'TTTTTTTTTTTTTTTTTTTTT' return result #open the file dnafile = 'AY162388.seq' file = open(dnafile, 'r') #read the sequence and strip the carriage returns sequence = '' for line in file: sequence += line.strip() print sequence #call the function to add the poly-T tail sequence = add_tail(sequence) print sequence