python program to get equally distributed number from given range

Solutions on MaxInterview for python program to get equally distributed number from given range by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "python program to get equally distributed number from given range"
Renata
27 Jan 2017
1def steps(start,end,n):
2    if n<2:
3        raise Exception("behaviour not defined for n<2")
4    step = (end-start)/float(n-1)
5    return [int(round(start+x*step)) for x in range(n)]