Write a six random verification program code, request the code comprises at least one number, a lowercase letter, a capital letter

Random Import, String 

src_list = []
src_list.append (STR (the random.randint (1,9))) to generate a digital #
src_list.append (random.sample (string.ascii_lowercase, 1) [0]) # generates a lowercase letters
src_list.append (random.sample (string.ascii_uppercase, 1) [0]) # generate a capital letter
three = random.sample (string.digits + string.ascii_lowercase + string.ascii_uppercase, 3) # 3 generated by the size letters and numbers list
for I in Three:
src_list.append (I) is added to all numbers # src_list in
random.shuffle (src_list) # disrupting the good combination list
Result = '' .join (src_list)
Print ( result)

Guess you like

Origin www.cnblogs.com/fxm12138/p/12114928.html