mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
8aa34f2d6e
commit
16086a346f
@ -1,18 +1,20 @@
|
||||
import random as r, sys as s
|
||||
|
||||
r.seed(10)
|
||||
|
||||
for _ in range(100):
|
||||
i = r.randint(1, 10)
|
||||
assert i <= 10
|
||||
assert i >= 1
|
||||
i = r.random()
|
||||
assert 0.0 <= i <= 1.0
|
||||
i = r.uniform(3.0, 9.5)
|
||||
assert 3.0 <= i <= 9.5
|
||||
|
||||
a = [1, 2, 3, 4]
|
||||
b = (1, 2, 3)
|
||||
r.shuffle(a)
|
||||
r.choice(a)
|
||||
r.choice(b)
|
||||
assert r.choice(a) in a
|
||||
assert r.choice(b) in b
|
||||
|
||||
assert 0.0 <= r.random() <= 1.0
|
||||
|
||||
r.seed(10)
|
||||
assert r.randint(1, 1000) == 266
|
||||
assert r.randint(1, 1000) == 126
|
||||
|
Loading…
x
Reference in New Issue
Block a user