You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
408 B
22 lines
408 B
6 years ago
|
try:
|
||
2 years ago
|
import random
|
||
6 years ago
|
except ImportError:
|
||
2 years ago
|
print("SKIP")
|
||
|
raise SystemExit
|
||
6 years ago
|
|
||
|
try:
|
||
|
random.randint
|
||
|
except AttributeError:
|
||
5 years ago
|
print("SKIP")
|
||
6 years ago
|
raise SystemExit
|
||
|
|
||
5 years ago
|
print("random")
|
||
6 years ago
|
for i in range(50):
|
||
|
assert 0 <= random.random() < 1
|
||
|
|
||
5 years ago
|
print("uniform")
|
||
6 years ago
|
for i in range(50):
|
||
|
assert 0 <= random.uniform(0, 4) <= 4
|
||
|
assert 2 <= random.uniform(2, 6) <= 6
|
||
|
assert -2 <= random.uniform(-2, 2) <= 2
|