menator01
King Coder
Simple password generator
output
Python:
# Do the imports
from random import sample
import string
# Combine upper and lower case letters with digits and special characters
# into a string
characters = string.ascii_letters + string.digits + '!@#$&*+'
# Define the function
def password_generator():
# Return a joined string with 10 sample charcters
return ''.join(sample(characters, 10))
# Do a loop calling the function 10 times to get 10 random passwords
for i in range(10):
print(password_generator())
output
Code:
1!Ixl&yfH9
54&vCPmDlM
m63oQwMcLV
2T$W8uAaRv
D[email protected]
[email protected]
XWEhrjw6qc
ZLmyoYEiG3
IigoYuevlO
*zai!$4epk