6个验证码,随机数字字母,考察chr(数字转字母)和ord(字母转数字)
#随机字母数字,验证码
import random
temp = ""
for i in range(6):
a = random.randrange(0,4)
if a == 1 or a == 3:
rad = random.randrange(0,10)
temp = temp + str(rad)
else:
rad = random.randrange(65,91)
r1 = chr(rad)
temp = temp + r1
print(temp)