def truncate(oligo,is5prime,length): if is5prime == True: #print oligo return oligo[:length-1] else: return oligo[length+1:]