You are on page 1of 1

***Loop by index

-returns numerical values


-numerical value can be used as index for accessing list items
-+ use of len() function:

While loops
-when a condition is met, repeat the code within the while loop body

The Interchange Between For Loops and While Loops


-Transfer increment to range / other way round
E.g for i in range len(e.list) becomes i=1, while i<= len(e.list), i+1
-The change in how a range of numbers is presented
For loop: for counter in list/ range of numbers
While loop:

Loop by value

You might also like