import randint python code example

Example 1: python randint

from random import randint

# generate an integer between 3 and 9 (inclusive range).
# (see randrange for exclusive range)
print(randint(3, 9))

Example 2: randint()

import random

print(random.randint(2, 8))    
# This generates a random number from 2 to 8

Example 3: import os from random import randint

import os
from random import randint
def amazon_gc():
os.system("clear")
print("Amazon giftcard generator")
print("Stop this with ctrl+c")
print("Starting generating giftcards........")
try:
while 1 == 10:
char = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','V','W','X','Y','Z']
giftcard = (random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char))
h = (''.join(map(str, giftcard[0:4])))
u = (''.join(map(str, giftcard[4:10])))
n = (''.join(map(str, giftcard[10:])))
print("==================================")
print("Amazon giftcard: ")
d = (h+'-'+u+'-'+n)
print(h+'-'+u+'-'+n)
print("==================================")
time.sleep(5)
except KeyboardInterrupt as e:
print("bye"