This question shows research effort; it is useful and clear
2
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
假设我正在遍历 python 中的列表:
lines = [1, 2, 3, 4]
linecount = len(lines)
#I want to be able to do this:
for i, j in range(linecount - 1, -1, -1), range(linecount, -1, -1):
print i, j
"""
This would print out
3 4
2 3
1 2
0 1
0 0
"""