I have a string like rna = "UACGAUGUUUCGGGAAUGCCUAAAUGUUCCGGCUGCUAA"
and I want to iterate through the string and capture the different strings which start with 'AUG'
and with 'UAA'
or 'UAG'
or 'UGA'
.
This is the code I've written so far:
rna = "UACGAUGUUUCGGGAAUGCCUAAAUGUUCCGGCUGCUAA" # start --> AUG; STOP --> UAA, UAG, UGA
hello = " "
n = 3
list = []
for i in range(0, len(rna), n):
list.append(rna[i:i+n])
for i in list:
if i == "AUG":
hello += i
i = i + 1
if i != "UAA" or "UAG" or "UGA":
hello += i