File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ import random
2+ import string
3+
4+ def generate_password (length = 12 ):
5+ characters = string .ascii_letters + string .digits + string .punctuation
6+ password = '' .join (random .choice (characters ) for _ in range (length ))
7+ return password
8+
9+ if __name__ == "__main__" :
10+ password_length = int (input ("Enter the desired password length: " ))
11+ generated_password = generate_password (password_length )
12+ print ("Your generated password is:" , generated_password )
Original file line number Diff line number Diff line change 1+ import random
2+ import string
3+
4+ def generate_password (length = 12 ):
5+ characters = string .ascii_letters + string .digits + string .punctuation
6+ password = '' .join (random .choice (characters ) for _ in range (length ))
7+ return password
8+
9+ if __name__ == "__main__" :
10+ password_length = int (input ("Enter the desired password length: " ))
11+ generated_password = generate_password (password_length )
12+ print ("Your generated password is:" , generated_password )
You can’t perform that action at this time.
0 commit comments