Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

random integers function to print integers with in a range

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 by github.com #
 
PREVIOUS NEXT
Tagged: #random #integers #function #print #integers #range
ADD COMMENT
Topic
Name
3+5 =