Q:

Python - Is there a built-in function that creates a list of numbers, given the min, the max and the step?

What I'm looking for is something doing exactly what "range" does, but with the maximum value at the end of the list. Does such a function exist? It is of course very easy to do it without any built-in function:
my_list = range(min_val,max_val,step_val)
my_list.append(max_val)

Or:
my_list = [val for val in range(min_val,max_val+1,step_val) if val <= max_val]

But I'd prefer to use a built-in function for a better code readibility.

A:

range(min_val,max_val + step_val, step_val)

A:

No, there is no additional built-in function. It is trivial to set the end value to max_val + step if you need the end value included:
def range_inclusive(start, stop=None, step=1):
    if stop is None:
        start, stop = 0, start
    return range(start, stop + step, step)

