Skip to main content

Integer.down_to

down_toninclude_endstep

Group: Input
Aliases: range

Documentation

Creates a decreasing right-exclusive range of integers from self to n.

Arguments

  • n: The end of the range.
  • include_end: Specifies if the right end of the range should be included. By default, the range is right-exclusive.
  • step: The step between each element in the range. By default, the step is 1. Step should be a positive integer and will be subtracted between each.

Examples

Create a range containing the numbers 5, 4, 3, 2, 1.

      5.down_to 0

Create a range containing elements 3, 2, 1.

      3.down_to 1 include_end=True