Skip to content

Instantly share code, notes, and snippets.

@tkoki
Created October 24, 2021 23:38
Show Gist options
  • Save tkoki/3942e5e90f2459e8d13b252ac7ac2130 to your computer and use it in GitHub Desktop.
Save tkoki/3942e5e90f2459e8d13b252ac7ac2130 to your computer and use it in GitHub Desktop.
Pythonで複数のリストの要素とインデックスを同時に取得する
lista = [1, 2, 3]
listb = ['a', 'b', 'c']
for idx, (la, lb) in enumerate(zip(lista, listb)):
print(idx, la, lb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment