xxxxxxxxxx
import random
# Generate a random integer between 1 and 10 (inclusive)
random_number = random.randint(1, 10)
print(random_number) # Print the generated random integer
xxxxxxxxxx
import random
# generates completely random number
x = random.random()
# generates a random int
x = random.randint()
# generates a random int in a range
x = random.randint(1, 100)
# NOTE: RANGE DOESN'T WORK FOR random.random()
xxxxxxxxxx
import numpy as np
#Generate 15 numbers between 25 and 60
np.random.randint(25,60, size=(15))
xxxxxxxxxx
import random
nbr = random.randint(1, 10)
print(nbr)
import numpy as np
uniform_nbrs = np.around(np.random.uniform(size=6), decimals=2)
print(uniform_nbrs)
xxxxxxxxxx
# Generates a random number between i and j
a = random.randrange(i, j)
xxxxxxxxxx
// Get a random number between 20 and 30
Math.round((Math.random() * (30 - 20 + 1)) + 20);
xxxxxxxxxx
#import the random module
import random
#get a random integer between 0 and 100
print(random.randint(0, 100))
xxxxxxxxxx
#import the random module
import random
#get a random integer between 0 and 100
print(random.randint(0, 100))