python 123 + 아 날로 그 볼 륨 C 종합 응용 문제 + 랜 덤 비밀번호
4208 단어 python 2 급
import random
random.seed(0x1010)
s="abcdefghijklmnopqrstuvwxyzABCDEFGH\
IJKLMNOPQRSTUVWXYZ1234567890!@#$%^&* "
ls=[]# ,
excludes=""
while len(ls)<10:# 10
pkw="" #pseudo keyword
while True:
pkw+=s[random.randint(0,len(s)-1)]
if pkw[0] not in excludes:
break
pkw=""
for i in range(9):
pkw+=s[random.randint(0,len(s)-1)]
ls.append(pkw)
excludes+=pkw[0]
fo=open(" .txt","w",encoding="utf-8")
fo.write("
".join(ls))
fo.close()