Last active
August 9, 2019 13:37
-
-
Save lawrencechen0921/f4ebe89a80f3b73fd88ae47c9acfb28b to your computer and use it in GitHub Desktop.
密碼隨機產生器- random pwd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string #匯入模組string | |
import random #匯入模組random | |
chs = string.ascii_letters + string.digits #ascill編碼的英文字母大小寫letters 以及 加入ascill數字 | |
pwd="" | |
for x in range(random.randint(8,12)): #會回傳8-12次的數字 | |
pwd+=random.choice(chs) #隨機選一個 | |
print(pwd) #列印出來 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so good