Every line of 'random.randint' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
87 def randomize( min, max ): 88 return random.randint( min, max )
16 def randint(a, b): 17 return a + int(random.random() * (b + 1 - a))
15 def rando(): 16 return random.StrongRandom().randint(2, 20000000)
16 def randint(self): 17 return random.randint(0, 999999999)
33 def gen_random(): 34 return random.random()
16 def r(): return random.randint(0, 255)
171 def rand_int(low, high): 172 return np.random.randint(low, high)
15 def bigrandom(): 16 return int(randy.random()*1000000)
154 def pick_random(a, b): 155 a, b = map(convert_to_num, (a, b)) 156 a, b = a[0], b[0] 157 if isinstance(a, float) or isinstance(b, float): 158 return random.uniform(a, b) 159 else: 160 return random.randint(a, b)
87 def randrange(start, stop=None, step=1): 88 """Choose a random item from range(start, stop[, step]). 89 90 This fixes the problem with randint() which includes the 91 endpoint; in Python this is usually not what you want. 92 93 EXAMPLES: 94 sage: randrange(0, 100, 11) 95 11 96 sage: randrange(5000, 5100) 97 5051 98 sage: [randrange(0, 2) for i in range(15)] 99 [0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1] 100 sage: randrange(0, 1000000, 1000) 101 486000 102 sage: randrange(-100, 10) 103 -56 104 """ 105 return _pyrand().randrange(start, stop, step)