Convert sequence from DS to Python

Hello!
How can I convert this piece of code from Design Script into Python:
0…#x#y;
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
thanks!

@DavidMena You can do something like this:


image

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
https://docs.python.org/3/library/stdtypes.html#range

1 Like