标签:int += 随机密码 str temp 随机 range random print
password = ‘‘
for i in range(8):
current = random.randrange(0,8)
if current > i:
temp = random.randint(0,9)
elif current < i:
temp = chr(random.randint(65,90))
else:
temp = chr(random.randint(97,122))
password += str(temp)
print password
标签:int += 随机密码 str temp 随机 range random print
原文地址:http://blog.51cto.com/yht1990/2141185