Welcome, guest | Sign In | My Account | Store | Cart

A one liner password generator in python. Was writen as part of an article I wrote on generating password.

Python, 4 lines
1
2
3
4
import random
import string

pass_gen = lambda length, ascii =  string.ascii_letters + string.digits + string.punctuation: "".join([list(set(ascii))[random.randint(0,len(list(set(ascii)))-1)] for i in range(length)])