1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Dec 2012
Posts
6
Rep Power
0

Hom work Help (Random)

Hello i need a help

inum1=random.randrange(0,50)
inum2=random.randrange(0,35)
inum3=random.randrange(0,600)
how can i make that this code in loop evry time the numbers will be lower and lower and not gust diferent from each other in allot numbe?
2. Monte-Carlo simulation of some sort of situation.
Code:
```import random
L = []
while len(L) < 100:
(n, count,) = (9999, 0,)
while n:
count += 1
n = random.randrange(n)
L.append(count)

print('mean number of trials: %g'%(sum(L)/float(len(L))))```
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Dec 2012
Posts
6
Rep Power
0
Originally Posted by b49P23TIvg
Monte-Carlo simulation of some sort of situation.
Code:
```import random
L = []
while len(L) < 100:
(n, count,) = (9999, 0,)
while n:
count += 1
n = random.randrange(n)
L.append(count)

print('mean number of trials: %g'%(sum(L)/float(len(L))))```

can you please make it more simple.
i cant use this simbols.

thank for helping
4. Code:
```import random

n = 99999                               # in allot numbe?

while n:                                # code in loop
print(n)
n = random.randrange(n)          # numbers will be lower and lower

print(n)  # (zero)```