import random
def random1():
headlist = ["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"]
return "".join(random.choice(headlist) for k in range(7)) \
+ "".join(random.choice("0123456789") for i in range(4))
def random2():
headlist = ["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"]
return "".join(random.choice(headlist) for k in range(7)) \
+ "".join(random.choice("0123456789") for i in range(4))
for num in range(40000):
print(random1())
没啥问题,我执行你的代码直接跑到了40000个