how to use random in python
import random
print(random.randint(3, 7)) #Prints a random number between 3 and 7
array = [cars, bananas, jet]
print(random.choice(array)) #Prints one of the values in the array at random
how to use random in python
import random
print(random.randint(3, 7)) #Prints a random number between 3 and 7
array = [cars, bananas, jet]
print(random.choice(array)) #Prints one of the values in the array at random
which function to use in random module for a list in python
random.choice
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"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us