📜  在 python 代码示例中创建自己的范围函数

📅  最后修改于: 2022-03-11 14:46:21.035000             🧑  作者: Mango

代码示例2
def range_with_step(start_num,end_num,step_num):
    sequence2 = [start_num]
    while start_num < end_num:
        start_num += step_num
        sequence2.append(start_num)
    return sequence2
print(range_with_step(0,6,3))