Convert sequence from DS to Python

How can I convert this piece of code from Design Script into Python:
A sequence of numbers from 0 to N(x) given the step(y).
I haven’t achieved it with range(0,x,y) because it returns a range from 0 to x, not a list of x numbers.
Attached is the desired result. Sequence_DS

@DavidMena You can do something like this:


start = IN[0] if IN[0] else 0
numbers = IN[1]
step = IN[2] if IN[2] else 1
OUT = [step*i+start for i in range(numbers)]
1 Like

OUT = range(0, IN[0]*IN[1], IN[1])test

1 Like

@AmolShah @201648rider Thank you!

And note: range works for numbers and letters…
range (start, stop, step)

Here is the doc for Python range function

1 Like