Use the built-in function enumerate() : for idx, x in enumerate(xs): print(idx, x). It is non-pythonic to manually index via for i in range(len(xs)): x ...
確定! 回上一頁