1
0

random.py 270 B

1234567891011121314
  1. _inst = Random()
  2. seed = _inst.seed
  3. random = _inst.random
  4. uniform = _inst.uniform
  5. randint = _inst.randint
  6. def shuffle(L):
  7. for i in range(len(L)):
  8. j = randint(i, len(L) - 1)
  9. L[i], L[j] = L[j], L[i]
  10. def choice(L):
  11. return L[randint(0, len(L) - 1)]