Question : python random integer in range
Answered by : mohammad-usama
import numpy as np
#Generate 15 numbers between 25 and 60
np.random.randint(25,60, size=(15))
Source : | Last Update : Mon, 13 Sep 21
Question : python random integer in range
Answered by : carson-stevens
import random
print(random.randint(0,9))
Source : https://stackoverflow.com/questions/3996904/generate-random-integers-between-0-and-9 | Last Update : Mon, 22 Feb 21
Question : Generate random number from range python
Answered by : jjsseecc
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)
Source : | Last Update : Thu, 24 Dec 20
Question : generate random integers in a range
Answered by : ayaan-rao
import random
print("Generating 3 random integer number between 100 and 999 divisible by 5")
for num in range(3): print(random.randrange(100, 999, 5), end=', ')
Source : https://pynative.com/python-random-number-generation-exercise-questions-and-challenge/ | Last Update : Tue, 16 Nov 21
Question : random in range
Answered by : shiny-stag-5uuvszw2wo1p
// Get a random number between 20 and 30
Math.round((Math.random() * (30 - 20 + 1)) + 20);
Source : | Last Update : Mon, 18 May 20
Question : random integers function to print integers with in a range
Answered by : mariaa-developer
function randomInteger(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min;
}
randomInteger(1, 100); // returns a random integer from 1 to 100
randomInteger(1, 1000); // returns a random integer from 1 to 1000
Source : https://github.com/sudheerj/javascript-interview-questions#what-are-the-possible-ways-to-create-objects-in-javascript | Last Update : Sun, 25 Sep 22