📜  python程序从给定范围内获取均匀分布的数字 - Python代码示例

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

代码示例1
def steps(start,end,n):
    if n<2:
        raise Exception("behaviour not defined for n<2")
    step = (end-start)/float(n-1)
    return [int(round(start+x*step)) for x in range(n)]