Python for Loop with Index

February 24, 2019
nums = [1, 2, 3, 4, 5]
for index, value in enumerate(nums):
  print(index, value)
for index in range(len(nums)):
  print(index, nums[i])
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.