| VarRandom/velvet_shell | VarRandom/s9160605122 | ||||
|---|---|---|---|---|---|
| n | n | 1 | from itertools import cycle | ||
| 1 | import random | 2 | import random | ||
| n | 2 | from itertools import cycle | n | ||
| 3 | 3 | ||||
| t | 4 | def randomes(sequence): | t | 4 | def randomes(seq): |
| 5 | cyclable_generator = (list(x) for x in sequence) | 5 | l = [tuple(t) for t in seq] | ||
| 6 | for i in cycle(cyclable_generator): | 6 | for p in cycle(l): | ||
| 7 | yield random.randint(*i) | 7 | yield random.randint(*p) | ||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||