How to use a for-loop with range in Python

Using a for-loop with range(start, stop) iterates over a sequence of integers from start to stop. For example, iterating over range(0, 3) will access the numbers 0, 1, and 2.

Solution for How to use a for-loop with range in Python : You can use range() to print a sequence of numbers Use range(start, stop) in a for-loop to iterate over a sequence containing the integers from start up to stop.

Use range(start, stop, step) in a for-loop and include the optional step parameter to specify how to increment each element in the sequence.

for number in range(0, 6, 2):


how-to-use-a-for-loop-with-range-in-python