验证码

 1 import random
 2 
 3 def v_code():
 4 
 5     code = ''
 6     for i in range(5):
 7 
 8         num=random.randint(0,9)
 9         alf=chr(random.randint(65,90))
10         add=random.choice([num,alf])
11         code += str(add)
12     return code
13 
14 print(v_code())

 

posted @ 2019-04-14 19:45  挑水工  阅读(100)  评论(0编辑  收藏  举报