在看雪上看到的问题:
由2个大写字母及8个数字组成的字符串,大写字母只用16个,即:A,B,C,D,E,F,H,K,P,Q,S,T,W,X,Y,Z;数字只用2,3,4,5,6,7,8,9;第1,第2位是字母,第3至10位是数字,组成例如:PC62565993、SW58527588 等等之类的字符串
然后调试了一下python实现程序:
#-*-coding:utf-8 -*-
import random
def GenerateSerial():
Letter=["A","B","C","D","E","F","H","K","P","Q","S","T","W","X","Y","Z"];
Arabic="23456897"
str=random.sample(Letter,2);
num=random.sample(Arabic,8);
serial="".join(str)+"".join(num)
print serial
if __name__=="__main__":
print "请输入需要的数量number="
number=raw_input()
for i in range(int(number)):
GenerateSerial();
raw_input("Waiting...")