Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Python 3 codes for loops
In my python script, there are 7 rows (0 to 6) in a list of lists (alignments). The SeqIDs of the first 2 rows, the next 2 rows and the last 3 rows are similar. Now, while appending the rows using the following codes
uniques = 
ap = open(tempparse, ‘w’)
for row in range(len(alignments)):
for compare in range(row+1,len(alignments)): ...... ...... .......
the last row (i. e. the last one of the last 3 rows in the list ) is not appended because it does not have any subsequent row to compare, and therefore, the six rows are appended except for the last one.
How can I resolve this issue?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×