Random int value : Random « Development « Python






Random int value

 

import random

random.random(  )
random.random(  )

print random.randint(1, 10)
print random.randint(1, 10)

   
  








Related examples in the same category

1.Demonstrates random number generation
2.Random integers produced by randrange.Random integers produced by randrange.
3.random number generationrandom number generation
4.Random Choice Random Choice
5.Sampling without replacementSampling without replacement
6.Random floatRandom float
7.Random string value
8.Demonstrates the range() functionDemonstrates the range() function
9.Random integer chosen from range(6)Random integer chosen from range(6)