如何用计数器在python中循环

2025-06-22 15:16:42
推荐回答(1个)
回答1:

通常有这样的方法:
for index, item in enumerate(n):
if index % nth == 0: # If the output is not like you want, try doing (index + 1), or enumerate(n, start=1).
print(item)