I’m trying to loop two DNA sequences:
a = "AAAGCTAGCTAGCTAGACT"
b = "ATAGCTAGCCAGCTAAACT"
for (i, j) in (a,b)
println(i, j)
end
It gives a result:
AA
AT
Why does the loop stop at the 2nd iteration?
I know I’d better do it with zip() as :
for (i, j) in zip(a,b)
println(i, j)
end
and it gave the right answer.
AA
AT
AA
GG
CC
TT
AA
GG
CC
TC
AA
GG
CC
TT
AA
GA
AA
CC
TT
But still, I don’t understand why iteration stopped at the 2nd round without zip(), and it didn’t raise any error! Does anyone have any ideas? I can’t find the answer in the doc (or I didn’t go to the right place)
Julia version:
v"1.7.3"
Interesting approaches: