import random def GetCode(num): code = '' for i in range(num): w = random.choice([chr(random.randrange(65, 91)), random.randrange(10)]) code += str(w) return code print(GetCode(5))
import random def GetCode(num): code = '' for i in range(num): w = random.choice([chr(random.randrange(65, 91)), random.randrange(10)]) code += str(w) return code print(GetCode(5))
转载于:https://www.cnblogs.com/zhanghr0728/articles/7879650.html