Counting Step Size

Description

The third argument in a for loop controls the step size. Notice the indentation.

Sage Cell

Options

for i in range(1,6,2):
    print(i)

Tags

Primary Tags: programming

Secondary Tags:

Related Cells

Counting and Iteration
Iteration, Tables, and String Formatting

Attribute

Permalink:

Author: Sage Tutorial v7.6

Date: 07 Jul 2017 15:38

Submitted by: Tom Judson

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License