Python: Password generator

By DaLuSt | Random programming tools | 3 Jan 2022


Password generator

For the next semi-useless simple tool, my first attempt at a very basic password generator.

Code

import string
from random import *

characters = string.ascii_letters + string.punctuation  + string.digits # pasword build-up
password =  "".join(choice(characters) for x in range(randint(8, 16))) # pasword length
print(password)

 

Result

5 x print

%BzX~O"^J7vtSkQ

7D.914N('^Xq

e3:{[email protected]~pKna

au]_7BPk.6(m

c%l49[r}<CQ-

Ps. if you know a way to print an x number of random passwords into a list with this generator, please let me know. 

Thanks for stopping by the semi-useless post. :)

 

 

 

 

How do you rate this article?


8

0

DaLuSt
DaLuSt

This is a story about a young dutch adolescent who studies Biomedical Research. Join him in his epic quest to find the one thing that everyone seeks, the ever-growing need for entertainment.


Random programming tools
Random programming tools

The place to learn about completely useless programming code is certainly not to be taken seriously, but still, a place to try some completely random code which I find on my journey in becoming a data scientist. Mainly in Python or R, but who knows what the future will bring.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.