您的位置: 首页 > IT文章 > 随机码 随机码 分类: IT文章 • 2022-03-25 16:19:56 #随机验证码 import random def v_code(): code='' for i in range(5): num = random.randint(0,9) alf =chr(random.randint(65,90)) add = random.choice([num,alf]) code+=str(add) return code print(v_code())