In the following example, we loop through a list of numbers, and use the variable digit to hold each number in turn: Strings in Python are considered “sequences” — they can be iterated over, and the ...
Pythonのfor文は、リストから要素を直接取り出して処理できるため、非常に直感的で便利です。 しかし、実務でコードを書いていると、要素だけでなく**「現在、何番目の要素を処理しているのか(インデックス)」や「何回目のループなのか」**という情報 ...