Respuesta :

Answer:

See Explanation

Explanation:

A for loop has the syntax:

for(start; end; increment/decrement){

.....

Some Actions

.

}

Notice that the syntax of the for loop:

- indicates the start of the loop

- indicates the end of the loop

- indicates the condition of the loop which could be either an increase or decrease

The syntax above is a way of traversing using a for loop.

1. This syntax gives the programmer a direct and easy access to the list element

2. When there is an easy access to the list element, the execution time of the program will reduce and the program will be more efficient

3. Lastly, the programmer can update any element of the list using the same iteration.

fichoh

Traversing through a lengthy list can be done effectively using a for loop, with a specified action being performed on each iterated element along the way.

  • With for loops, each element of a list can be accessed one after the other, for each accessed element, an update of the element might be done effectively.

The program below illustrates a straightforward way of applying for loops to a list with each element in the list accessed and updated.

The program is written in python 3 thus :

nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]

for index, num in enumerate(nums):

#iterate though the index values and elements in the list

nums[index] = num + 1

#access each element and update the value.

print(nums)

#display the updated list.

Learn more : https://brainly.com/question/20699569