rand() function code example
Example 1: randint()
import random
print(random.randint(2, 8))
# This generates a random number from 2 to 8
Example 2: random number generator c
rand() % (maxlimit + 1 - minlimit) + minlimit;
import random
print(random.randint(2, 8))
# This generates a random number from 2 to 8
rand() % (maxlimit + 1 - minlimit) + minlimit;