.
from random import *
def randstr():
#Generates a random string.
#String consists of numbers 1-9, letters a-z & A-Z.
#Letters and number can be in any order.
#Final generated number stored in "rand" variable.
#767,544,201,216 possible combinations
lower = ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
upper = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
ch = randint(1,2)
if ch == 1:
case1 = lower
else:
case1 = upper
del ch
ch = randint(1,2)
if ch == 1:
case2 = lower
else:
case2 = upper
del ch
ch = randint(1,2)
if ch == 1:
case3 = lower
else:
case3 = upper
del ch
ch = randint(1,2)
if ch == 1:
case4 = lower
else:
case4 = upper
del ch
test1x = choice(case1)
test2x = choice(case2)
test3x = choice(case3)
test4x = choice(case4)
test1y = randint(1,9)
test2y = randint(1,9)
test3y = randint(1,9)
test4y = randint(1,9)
strconv1 = str(test1y)
strconv2 = str(test2y)
strconv3 = str(test3y)
strconv4 = str(test4y)
shuffled = [test1x, strconv1, test2x, strconv2, test3x, strconv3, test4x, strconv4]
shuffle(shuffled)
count = 0
for number in shuffled:
if count == 0:
sub_set = number
count = count+1
if count == 8:
rand = sub_set
quit
if count != 0:
if count != 8:
sub_set = sub_set+number
count = count+1
print (rand)
del test1x
del test2x
del test3x
del test4x
del test1y
del test2y
del test3y
del test4y
del strconv1
del strconv2
del strconv3
del strconv4
del shuffled
del count
del rand
del sub_set
del number
input ()
randstr()
from random import choice, randint, shuffle
from string import ascii_letters, digits
#Generates a random string.
#String consists of numbers 0-9, letters a-z & A-Z.
#Letters and number can be in any order.
#Final generated number stored in "rand" variable.
#218,340,105,584,896 possible combinations!
def randstr():
dig_let = (digits * 5) + ascii_letters
shuffled = list(choice(dig_let) for d in range (8))
shuffle(shuffled)
rand = "".join(shuffled)
print (rand)
input ()
randstr()