for loop
The for loop is used to iterate over a sequence (like a list, tuple, dictionary, set, or string). It iterates over items in the order they appear in the sequence.
for
loop Syntax:
Examples
Example:
Example:
using built-in range()
function
A built-in range function returns a sequence of numbers based on the given arguments
range(start, stop, step)
default:
start: defaults to 0
stop: required *
step: defaults to 1