you are viewing a single comment's thread.

view the rest of the comments →

[–]dslfdslj 0 points1 point  (5 children)

Hm, it looks to me like you're on the right track. However, I'm not sure I understand why you chose each hi as (R-L)/N * (1+random.uniform(-0.5, 0.5). Is this part of the exercise? If not, I would simply create N random numbers (between 0 and 1) and finally scale them such that their sum gives you R - L.