Skip to content

Instantly share code, notes, and snippets.

@Bnux256
Created August 12, 2021 11:48
Show Gist options
  • Save Bnux256/45257bfca3ecc965ea47e2dcadc1d15f to your computer and use it in GitHub Desktop.
Save Bnux256/45257bfca3ecc965ea47e2dcadc1d15f to your computer and use it in GitHub Desktop.
Python Password Generator
import random
import string
length = int(input("What length do you want your password? "))
characters = string.ascii_letters + string.punctuation + string.digits
password = ""
charList = random.sample(characters, length)
for x in range(len(charList)):
password += charList[x]
print(password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment