2021年5月4日星期二

How to Generate random code with 4 digit string and 4 digit number in Python?

I have this code

import random      FullChar = 'CDHKPQRVXY123456789'  total = 10  count = 8    for i in range(total):      unique_code = ''.join(random.sample(FullChar, count))      print(unique_code)  

how can i generate random code with just 4 digit string and 4 digit number in Python?

Expected Output:    FH98UK67  23YTP7H4  14XG3QD2  H12P56KV  
https://stackoverflow.com/questions/67394641/how-to-generate-random-code-with-4-digit-string-and-4-digit-number-in-python May 05, 2021 at 11:01AM

没有评论:

发表评论