LoginSignup
0
0

More than 3 years have passed since last update.

enumerate関数

Posted at

enumerate関数

インデックスと要素を同時に取り出すことができる

word_ja = ['あ','い','う','え','お']
word_en = ['a','b','c','d','e']

for idx, num in enumerate(zip(word_ja, word_en), start=1):
    ja, en = num
    print(idx, ja, en, nl)

----output----
1 あ a
2 い b
3 う c
4 え d
5 お e
--------------
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0