python3
for
loop with a list>>> for fruit in ["apple", "peach", "blueberry", "watermelon"]: ... print(fruit) ...
range
function>>> for number in range(5): ... print(number, end=', ') ... >>> for number in (1, 6): ... print(number, end=', ') ... >>> for number in (1, 6, 2): ... print(number, end=', ') ... >>> for number in (5, 0, -1): ... print(number, end=', ') ...
apple peach blueberry watermelon 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 3, 5, 7, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,