this module makes random numbers
import @random
# generates a random int between 1 and 10
println(random.randint(1, 10))
Initialize the random number generator
import @random
random.seed(1000)
Returns the current internal state of the random number generator
import @random
print(random.getstate())
import @random
# generates a random float less that 1
$rand = random.random()
println($rand)
This function gets a list and returns a random item from that list:
import @random
println random.choice([1, 2, 3])