kyclark / biofx_python

Code for Mastering Python for Bioinformatics (O'Reilly, 2021, ISBN 9781098100889)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why use ''.join() in chapter 14, solution 1, find_orfs()?

singing-scientist opened this issue · comments

For the following line in chapter 14, solution 1, find_orfs(), from page 281:

orfs.append(''.join(aa[start:stop]))

Could you help me understand why one would not use the following (presumably simpler?):

orfs.append(aa[start:stop])

In other words, what is the advantage of joining on the empty string in this situation?

Thanks as always!
Chase

Chase,

Actually, there are no advantages, and leaving out the join correct. I must have been thinking about ensuring this was a str and not a list. Thanks for the catch.

Ken