seq for generators

Output sequences of numbers.

Signature

> seq ...rest

Parameters

  • ...rest: sequence values

Examples

sequence 1 to 10

> seq 1 10
╭───┬────╮
│ 01 │
│ 12 │
│ 23 │
│ 34 │
│ 45 │
│ 56 │
│ 67 │
│ 78 │
│ 89 │
│ 910 │
╰───┴────╯

sequence 1.0 to 2.0 by 0.1s

> seq 1.0 0.1 2.0
╭────┬────────╮
│  01.0000 │
│  11.1000 │
│  21.2000 │
│  31.3000 │
│  41.4000 │
│  51.5000 │
│  61.6000 │
│  71.7000 │
│  81.8000 │
│  91.9000 │
│ 102.0000 │
╰────┴────────╯

sequence 1 to 5, then convert to a string with a pipe separator

> seq 1 5 | str join '|'