loop indexing 1

loop indexing

for index, item in enumerate(list):
	print("index:", index, "value:", item)

Here is what the above code is Doing:
1. We create a list of numbers.
2. We create a for loop that iterates over the list.
3. We use the enumerate() function to get the index and value of each item in the list.
4. We print the index and value of each item in the list.

Similar Posts