python 实例
时间:2021-06-20 18:07:43
收藏:0
阅读:0
# 四位验证码
"""四位数验证码""" code="" for i in range(4): print(i) index = random.randrange(4) #0-3 中随机取一个数 if index != i and index + 1 != i: code +=chr(random.randint(97,122)) #小写字母 elif index + 1 == i: code +=chr(random.randint(65,90)) #大写字母 else: code +=str(random.randint(1,9)) print(code)
评论(0)