标签:nop pre highlight 实现 put import count ;; utf-8
用random模块实现按照要求生成一定个数和一定位数的密码:
#Author by Andy #_*_ coding:utf-8 _*_ import random checkcode=‘‘ code=‘‘‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789!@#%&()*"{}‘‘‘ code_len=int(input(‘请输入密码长度:‘)) code_count=int(input(‘请输入密码个数:‘)) count = 0 while count < code_count: checkcode = ‘‘ for i in range(code_len): j=random.randint(0,len(code)-1) checkcode += code[j] print(checkcode) count+=1
标签:nop pre highlight 实现 put import count ;; utf-8
原文地址:http://www.cnblogs.com/pythonstudy/p/6209475.html