본문 바로가기
PRACTICE/Basic

[Python] 패스워드 생성기

by 1005 2021. 3. 2.

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import random
 
def getPass():
    alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
    password = ""
 
    for i in range(6):
        index = random.randrange(len(alphabet))
        password = password + alphabet[index]
 
    return password
 
print(getPass())
print(getPass())
print(getPass())

 

 

댓글