programming-examples/python/List/Python program access the index of a list.py
2019-11-15 12:59:38 +01:00

3 lines
104 B
Python

nums = [5, 15, 35, 8, 98]
for num_index, num_val in enumerate(nums):
print(num_index, num_val)