How to Generate a Random Integer From 0 to Designated Value


In this example we will show how to generate a random integer from 0 to the designated value in Python NumPy.

Source Code

from numpy import random

# generate a random integer from 0 to 50
n = random.randint(50)

print(n)

Output:

34
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments